-
- Downloads
[FIX] sale(_stock_margin): do not recompute the cost when the SO is sent
Steps to reproduce the bug:
- Create a storable product “P1”:
- change the cost to $20
- product category > costing method > standard price
- Create a SO:
- Add the product “P1”
- Change the cost from $20 to $10
- Save
- Sent the quotation by Email
Problem:
The `purchase_price` is recomputed and changes back to the original value.
When the quotation is sent, the state of the order lines change,
marking the field `qty_delivered_method` to be recomputed, but also
other computed fields depending on it, including the purchase_price
(because of the dependency added in sale_timesheet_margin).
To avoid this unexpected recomputation, we remove the useless
dependency on the `state` for the field `qty_delivered_method`.
There is no reference/check on the state in the method
_compute_qty_delivered_method or any of its overrides and
therefore the field should not be necessary in the compute
dependencies.
opw-2994136
closes odoo/odoo#103739
Signed-off-by:
Victor Feyens (vfe) <vfe@odoo.com>