Goffin Simon 130e71f2e4 [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
2017-04-05 09:25:18 +02:00
2017-04-05 07:50:53 +02:00
…
2016-12-19 14:19:26 +01:00
…
…
…
…
…
…

Build Status Tech Doc Help Nightly Builds

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, Purchase Management, ...

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.

If you are a developer you may type the following command at your terminal:

wget -O- https://raw.githubusercontent.com/odoo/odoo/10.0/setup/setup_dev.py | python

Then follow the developer tutorials

For Odoo employees

To add the odoo-dev remote use this command:

$ ./setup/setup_dev.py setup_git_dev

To fetch odoo merge pull requests refs use this command:

$ ./setup/setup_dev.py setup_git_review
S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%