Review: Disapprove

This is a very dangerous fix (res.currency is a core system object), and 
inappropriate given the way OpenERP uses floats rather than decimals.

Our floating point calculations are all performed with floats, and we have 
appropriate solutions for all cases based on floats. So for consistency, please 
do not introduce the use of Decimal in patches. For more info on the 
everlasting Float vs. Decimal discussion, see [1].

Here the problem is the equality comparison in account_voucher. For checking 
that 2 amounts are equal with regard to an appropriate precision, the 2 amounts 
should be subtracted and checked with res.currency.is_zero().
You can see other examples of how this is done in other places in the code, for 
example [2].

Thanks!

[1] https://lists.launchpad.net/openerp-expert-accounting/msg00067.html
[2] 
http://bazaar.launchpad.net/~openerp/openobject-addons/trunk/view/5493/account_voucher/account_voucher.py#L940
-- 
https://code.launchpad.net/~openerp-dev/openobject-server/6.0-opw-18123-Lorenzo_Battistini/+merge/79087
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-server/6.0-opw-18123-Lorenzo_Battistini.

_______________________________________________
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