dad19a769a1123538d9717ff9b9134d97d3ff194
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
…
…
…
…
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
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%