-
- Downloads
[FIX] purchase: Add 'price_total' & 'price_tax' to the order lines tree
# Description The absence of those fields can generate a log note spam & performance issue when updating an order line value. # HOW TO REPRODUCE - Create PO with 40+ order lines (50 recommend) (* SA to reproduce would be nice) - Confirm PO (state needs to be "purchase") - Update the Ordered Quantity of the first line. - Save => PO Lines from page 2 and beyond have each created the following log message: "The ordered quantity has been updated." # Explanation The purchase.order.line onchange will not save any update on 'price_total' because it is not on the onchangeSpec. Then a purchase.order onchange is done, and this one does have 'order_line.price_total' on the onchangeSpec, forcing the onchange method to return the field 'order_line' (aka ALL the order lines) as updated. When saving the changes, the JS framework, who does not have the data for the order_lines on the 2nd page, will not correctly filter the fields with real changes, and add the 'product_qty' field (and more) to the "write" call for every order_line not in the 1st page. Then the write method, without checking if there is any real change on the product_qty, for each lines that has product_qty in the Write's values, will write in the log note and call a performance intensive method: _create_or_update_picking() OPW-2982004 closes odoo/odoo#104490 X-original-commit: e99cdd64 Signed-off-by:William Henrotin (whe) <whe@odoo.com> Signed-off-by:
David <dafr@odoo.com>
Please register or sign in to comment