Invoice amount due updates before saving
The amount due on journal entries is now computed live in the form. It also fixes unsaved invoice lines disappearing when an outstanding credit was added before saving.
The amount due on journal entries is now computed live in the form. It also fixes unsaved invoice lines disappearing when an outstanding credit was added before saving.
| Branch | Pull request | Commit |
|---|---|---|
| 19.0 | odoo/odoo#288894 ↗ | 84ff047f4e ↗ |
| 20.0 | odoo/odoo#289786 ↗ | ecb9deb3f4 ↗ |
[IMP] account: Improve account move amount due computation Before this commit, the account.move amount due field would only update on record saving (as it depended on line_ids). This caused a temporary out of sync situation between the total and the amount due on the move form view. This commit ensures that the amount due is computed even before saving the record so that out-of-sync situation is avoided. It also solves the following bug: Repro steps: 1) Create a new invoice 2) Add a customer and save the record 3) Add some invoice lines 4) without saving, add a payment from the outstanding credit Issue: The added (unsaved) invoice lines are removed Solution: This commit forces a record save before assigning outstanding credit task-6534794