diff options
| author | Goffin Simon <sig@odoo.com> | 2018-07-10 15:33:14 +0200 |
|---|---|---|
| committer | Goffin Simon <sig@odoo.com> | 2018-07-12 11:45:15 +0200 |
| commit | dad19a769a1123538d9717ff9b9134d97d3ff194 (patch) | |
| tree | da65152c6cfdac5fa4fae9923fe500df03ad3575 /addons/web/static/src/css | |
| parent | 718a5b76b8867f4b20d4f3beff3027198cd2154c (diff) | |
[FIX] sale: Price on SO not working with different uom
Steps to reproduce the bug:
- configuration on sale:
- Unit of measure: Some products may be sold/purchased in different units of measure (Advanced)
- Sale Price: Advaced pricing based on formulas (discounts, margins, rounding)
- Discount: Allow discounts on sale order lines
- kg as the Reference UOM for weight
- create an uom 10 kg
- Category: Weight
- Type: Bigger...
- Bigger ratio: 10.0
- create a product P
- Sale price: 100
- Unit of measure: kg
- Purchase UOM: kg
- create a pricelist "My pricelist"
- Discount policy: Show public price & discount to the customer
- Items : All products - 10% discount
- create a SO with "My pricelist"
- create a SO line with P, the unit price is automatically 90 with 10 % of discount
- change the uom of the line with 10kg
Bug:
The unit price of the line didn't change and the discount on the line disappeared.
In function product_uom_change, the uom of the SO line has been set in the context
of the product(like in function product_id_change). So in funciton _get_display_price,
the function _get_real_price_currency must be called with the uom of product in the context.
In this way, the lst_price will be fetch on product with the right uom without any bad conversion
(because uom.id == product_uom with uom from the parameters and product_uom from the context).
But with function get_product_price_rule, no need to call this function with the uom in context as
it is already set in the product(check "if uom_id: ... else ..." in this function).
The same logic has been applied in function _onchange_discount
opw:186385
Diffstat (limited to 'addons/web/static/src/css')
0 files changed, 0 insertions, 0 deletions
