Review: Needs Fixing

Hi,

even if this is better than before, i must admit that seeing this merge prop 
annoy me a little because you're changing a lot of lines of code and leaving 
issues in them.

I'm talking about the common hardcoded precision issue. For example in 
line 121        + res[id][f] = float_round(res.get(id, {}).get(f, 0.0), dp) + 
float_round(res2.get(id, 0.0), 2)

this last precision of '2' is hardcoded and probably wrongly prevails on a 
defined decimal precision in the system. I didn't check the code but i guess it 
should be replaced by 'dp', to sum numbers with the same rounding parameter.

SO it would be a very nice improvement to check on each of your line diff to 
see if you're using a decimal precision from the system instead of an arbitrary 
hardcoded value. To know which decimal precision you should take, you can check 
the decimal precision of the field you're computing. 

And if you really want to do amazing job, you can move the definitions of 
existing decimal precisions into the decimal_precision module and comment in 
few words what's the most common use for each of them ;-)

Thank you
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1025649-api/+merge/137822
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-bug-1025649-api.

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to