Incoherence between on_change args in view and on_change prototype

Bug #1251354 reported by Alexis de Lattre
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Sales - Financial Controlling

Bug Description

In an up-to-date branch lp:sale-financial/6.1 :

in the file sale_line_watcher/sale_view.xml line 12 :

on_change="onchange_price_unit(price_unit ,product_id, discount, product_uom_qty, parent.pricelist_id)"

The argument before parent.pricelist is "product_uom_qty".

in the file sale_line_watcher/ line 27 :

def onchange_price_unit(self, cr, uid, ids, price_unit, product_id, discount, product_uom, pricelist, **kwargs):

-> The argument before "pricelist" is "product_uom" !!!! It should be product_uom_qty !

in the file sale_floor_price/ line 60 :

-> Same problem, the argument is "product_uom" and it should be "product_uom_qty"

in the file sale_markup/ line 94 :

-> Same problem, the argument is "product_uom" and it should be "product_uom_qty"
In this function, the argument "product_uom" is passed to the function product_obj.compute_markup(). This function is located in sale_markup/ line 51 and the argument product_uom is added to a copy of the context and passed to get_cost_field(). The function get_cost_field is located in the module product_get_cost_field in lp:margin-analysis... but it seems that they don't read 'product_uom' in the context, but maybe it is used in other functions... and it this case, it could have very bad consequences !!!

There is exactly the same error for the on_change on discount.

I plan to fix this bug in my merge proposal to upgrade to v7... and I don't plan to fix it in 6.1.

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

As the module wasn't ported and has been rewritten I remove the bug on 7.0 serie

no longer affects: sale-financial/7.0
Revision history for this message
Alexis de Lattre (alexis-via) wrote :


What do you mean by "the module wasn't ported and has been rewritten" ? Which module are you talking about ? Who rewrote it ?

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers