c6842f13040905370b781a59103dd2aa5fcf6c3c
**Current behavior:**
If a recurring sale order has an associated sale order option
and the recurring plan of the order is changed, a trace back
occurs.
**Expected behavior:**
The recurring plan can be changed as it ordinarily would.
**Steps to reproduce:**
1. Add a recurring product to a sale order
2. Add an optional recurring product to the order
3. Try to change the recurring plan of the order to encounter
the trace back
**Cause of the issue:**
This flow causes some 'phantom' sale order lines to have their
price recalculated (phantom because they have no price, qty,
currency, nor order_id field values). During this recalculation
a currency_id is expected either in the line itself or in the
sale order it is a part of. Because there is no value for either
of these, it fails the ensure_one() method in the sequence
(0 vals, expects 1).
The phantom lines are created in the `sale.order.option` model
in the `sale_management` module, in `_compute_price_unit()` and
`_compute_discount()`.
**Fix:**
Call `invalidate_recorset(flush=False)` on these cached records
at the end of the methods in which they are created.
opw-3754297
closes odoo/odoo#158950
X-original-commit: 16f51c93d0f9cadcdbcd9ed2d58e43ed0d550bf9
Related: odoo/enterprise#59301
Signed-off-by: Vincent Ethan <etvi@odoo.com>
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
…
…
…
…
…
…
…
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
Getting started with Odoo
For a standard installation please follow the Setup instructions from the documentation.
To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%