diff options
| author | Goffin Simon <sig@odoo.com> | 2017-04-04 11:39:37 +0200 |
|---|---|---|
| committer | Goffin Simon <sig@odoo.com> | 2017-04-05 09:25:18 +0200 |
| commit | 130e71f2e44b3508531cbcda2b9ca9de91e8e8fd (patch) | |
| tree | 1a998c4ac5750ea04c8cb127fac142c07980face /addons/web/static/src/js/views/basic/basic_controller.js | |
| parent | d24f86337eea491253b498256a04cc25a8e1d894 (diff) | |
[FIX] sale: _get_display_price with pricelist item based on other pricelist
Create a product P with a price = 1799
Make a pricelist P1 in USD with an item I1 for a product P with a
fixed price to 100.
Set P1 with discount_policy = "with_discount"(include in price)
Make another pricelist P2 in USD with an item I2 based on P1.
I2 is a formula = 50% of the price
Set P2 with discount_policy = "without_discount"
Create a SO with P2 for the product P
Bug: The subtotal of P is 899.5 instead of 50
The problem came from _get_display_price wich in this case recomputed
the price according to the discount(in this case equal to 50% and this is
the good discount to display because P1 include the discount) and the lst_price
of the product(=1799) So the displayed price was equal to 899.5 instead of
50.
All the other cases worked because
1. P1 without_discount and P2 without_discount:
Price returned by _get_display_price was equal to 1799 with a discount of 97,2%
So the subtotal was equal to 50
2. P1 without_discount and P2 with_discount:
Price returned by _get_display_price was equal to 100 with a discount of 50%
So the subtotal was equal to 50
3. P1 with_discount and P2 with_discount:
Price returned by _get_display_price was equal to 50 with a discount of 0%
So the subtotal was equal to 50
And the last case(P1 with_discount and P2 without_discount) didn't work because:
Price returned by _get_display_price was equal to 1799 with a discount of 50%
So the subtotal was equal to 899.5
NB: The subtotal is computed with function "_compute_amount" with the following line:
price = line.price_unit * (1 - (line.discount or 0.0) / 100.0)
opw:724924
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_controller.js')
0 files changed, 0 insertions, 0 deletions
