IRC logs of #tryton for Monday, 2013-07-08

chat.freenode.net #tryton log beginning Mon Jul 8 00:00:03 CEST 2013
giedriushi cedk11:25
giedriuscedk: could you give an example how to set context in scenario of review970002?11:26
cedkgiedrius: you can't on instance method11:27
cedkgiedrius: so I'm not sure instance method is really needed there11:29
cedkgiedrius: but otherwise context should not be set because it is useless11:29
giedriuscedk: i can move the implementation from class method to instance11:30
giedriuscedk: then it would be possible to have both methods working11:30
cedkgiedrius: it is a possibility but it will be good to see if in the current code the instance method could be used11:32
giedriuscedk: it can be used in many places, see grep -ir "currency.compute" trytond/modules11:35
giedriuscedk: it is basically the same as with Uom.convert11:37
cedkgiedrius: no because of the context11:38
giedriuscedk: even it's better because current interface to convert quantity is not simple, you need to set context..11:39
giedriusi mean currency11:39
cedkgiedrius: I think you always have to set the context so better to have an interface that force the user to think about it11:39
giedriuscedk: i don't understand, why context is better than method argument?11:40
cedkgiedrius: a method argument will be good also11:44
giedriuscedk: as i understand, the context is used more for passing around the common data (not specific for single model), like user_id, company_id, etc..11:47
cedkgiedrius: context is used here because rate fields is a Function field that uses context11:48
cedkgiedrius: but I guess it could be a good improvement to pass the date as argument to avoid to have to set the context before calling compute11:49
giedriuscedk: alright, i'll work on the patch11:53

Generated by irclog2html.py 2.11.0 by Marius Gedminas - find it at mg.pov.lt!