Code review comment for lp:~alejandrosantana/ocb-addons/7.0-ocb-addons-fix-bug-1089229

Revision history for this message
Alejandro Santana (alejandrosantana) wrote :

8: OK, this can be changed, yes.
Yet, this comment on code puzzles me:
http://bazaar.launchpad.net/~openerp/openobject-addons/trunk/view/head:/sale/sale.py#L827

16: Mathematically shouldn't have to (if I am not wrong):
subtotalA = uom_qty * unit_price[for UoM] (<-- Usual calculation, isn't it?)

subtotalB = uos_qty * unit_price[for UoS] =
          = (uom_qty * uos_coeff) * (unit_price[for UoM] / uos_coeff) =
          = uom_qty * unit_price[for UoM] * (uos_coeff / uos_coeff) =
          = uom_qty * unit_price[for UoM] * 1 =
          = subtotalA
So no need for further calculations and rounding errors.

If any other calculation should be done, it should be done not at report level, but in a sales or product level, I think.
And this other comment in code seems the way to go to correct it definetely, not only in report, which was my aim:
http://bazaar.launchpad.net/~openerp/openobject-addons/trunk/view/head:/sale/sale.py#L632
(Same comments since, at least 6.1, but never implemented)

« Back to merge proposal