e227e7c3a24415f1d44cdbb055da4e6a22c10bb3
**ISSUE**
- Given a combo product with 2 combo_ids (pos.combo).
- Combo A
- A1, A2
- Combo B
- B1, B2
- When adding this combo product, it's possible that the user selects the
combination A1 & B1.
- And in another order, A2 & B1.
- ISSUE: Between those two orders, prices of first line (component A) will be
different. What we want is that the price of line corresponding to a component
(pos.combo.line) is consistent between orders.
**SOLUTION**
This can be achieved by establishing a constant in each pos.combo.line. We
choose the minimum lst_price of the components as this constant which we call as
`base_price` field.
The calculation will be practically the same as before, except unit price is now
based on the `base_price` field:
- Compute the original price - which will be based on the `base_price`.
- Recall: `base_price` is the minimum price among the `combo_line_ids` of a
pos.combo.
- We then divide the original price to the target price (which is the price of
the combo product) which we'll call the "prorateFactor".
- The price of the components are computed by multiplying the "prorateFactor" to
the `base_price`.
**Rounding error:** Both the original procedure and the new strategy introduced
in this PR suffers from rounding error. To prevent the rounding error, we
compute the error and distribute it to the last line of the combo.
**Combo (Extra) Price:** The `pos.combo.line.combo_price` is added on top of the
prorated price.
closes odoo/odoo#138352
Signed-off-by: Vlad Stroia (vlst) <vlst@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%