Technical Mailinglisten Archive

technical@mail.odoo.com

Avatar

Question regarding onchange api with stored compute fields

durch
Quartile Limited, Tim Lai
- 11.02.2019 06:02:11
Hi There,

Recently we are encountering a strange behavior in one of our environments.
When we try to update the "Unit Price" in the order line in any sales order form view, "Margin" is updated while the "Untaxed Amount", "Taxes" and "Total" are not updated immediately. Those values are not being updated until the "Save" button of the sales order is pressed. (Usually they will be updated when any Subtotal is updated.)
image.png
(Only "Margin" is changed, while all other fields remain)

Background information:
1. We do not have any customization on the fields/method, the logic related here should be standard, e.g. _amount_all() and _product_margin().
2. I have tried to log the execution of the method and the method is actually executed in a correct timing (right after the Subtotal of an order line is changed). The values are also corrected computed in the method, however the new values are not reflected to the form view.
3. I tried to caputre the "onchange" api call with the developer mode in Chrome, only "margin" is returned from the call (amount_total is not being returned)
image.png

It will be nice if anyone have any ideas on this. Please let me know what I could further check to identify the cause.

Best regards
Lai Tim Siu
コタエル株式会社 / Quartile Limited