Comment 2 for bug 1089229

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

Looks like this was never commited into trunk. Also, the fix proposed raises an error when trying to convert a localized price into float, due to the formatLang(...) passed to get_price_objects method. This happens when that localized format uses a comma for decimal separator instead of a dot.
The problem is in:
[[ formatLang(line.price_subtotal and get_price_objects(formatLang((line.price_unit * line.product_uom_qty / line.product_uos_qty)),line.product_uos_qty) or line.price_subtotal ,digits=get_digits(dp='Account'), currency_obj=o.pricelist_id.currency_id)]]
But, even correcting this, there might be some decimal differences with the subtotal calculated on invoices, which is based solely in UoM, not on UoS.
Even more, the round method in get_price_objects rounds to unit, looks like discards any decimal (let's say decimal accuracy = 0). But prices should respect 'Account' decimal accuracy, which is normally 2.

So, the root of this bug goes deeper and will not be really well solved till UoS is well implemeted into OpenERP, which should be done in core, not in any extension module. There are even some "TO-DO" and "FIX-ME" comments in the code since, at least 6.1, never corrected. Take a look to:
    http://bazaar.launchpad.net/~openerp/openobject-addons/trunk/view/head:/sale/sale.py#L632
    http://bazaar.launchpad.net/~openerp/openobject-addons/trunk/view/head:/sale/sale.py#L827
There is where the real bug lies: a feature not completely implemented.