odoo/addons/product
Olivier Dony da12f2b809 [FIX] product: pricelist: multiple corrections in UoM-related conversions
Pricelist computations need to consider 2 different Units
of Measure:
 - The default product UoM (product.uom_id), used as reference
   for the various quantities and amounts specified in each
   pricelist rules.
 - The `context UoM` is the UoM in which the result is requested,
   that is the list price UoM.

For example the 'price_min_margin' amount is meant for the unit
price of 1 x default UoM. When the context UoM is not the default
product UoM, it can be any UoM of the same UoM Category, and the
various quantities and amounts specified on the rule need to
be adapted accordingly:
  - min_quantity (expressed in terms of the default UoM)
  - price_surcharge (specified for 1 x default UoM)
  - price_min_margin (specified for 1 x default UoM)
  - price_max_margin (specified for 1 x default UoM)

The UoM corrections were not done consistently and resulted in
wrong prices when computing the price using a non-default UoM.
The cases were a conversion was needed or not were not properly
identified within the _price_rule_get_multi().

After this commit, the various code branches in _price_rule_get_multi
always ensures that:
 - price requested for: `qty` of `qty_uom_id`
 - `qty_in_product_uom` is the requested `qty` converted to default UoM
 - current (intermediary) price: `price` for  `price_uom_id`

Therefore `price` and `price_uom_id` are always in sync, and `price_uom_id`
can always be compared with `qty_uom_id' in order to know whether
a conversion is still needed.

This patch also corrects and extends the regression tests
introduced at revision 79ebe10.
2014-12-09 17:30:47 +01:00
..
i18n [I18N] Update translations from Launchpad 8.0 branches 2014-11-19 17:49:12 +01:00
report [REF] OpenERP --> Odoo in various UI texts (2) 2014-07-18 14:59:38 +02:00
security [IMP] add read access to all users for product.pricelist.type 2014-07-11 13:32:46 +02:00
static/img [IMP] Convert product demo png's to 8bit 2014-09-16 19:55:00 +02:00
test [IMP] product: refactoring of product variant. The main view became the view of product template and the product product (or product variant) are created with the variant values combinaison. Bom is splitted into bom and bom line and can use the variant combinaison. 2014-05-27 09:42:52 +02:00
tests [FIX] product: pricelist: multiple corrections in UoM-related conversions 2014-12-09 17:30:47 +01:00
views [IMP] Product pricelist converted to QWeb 2014-04-14 17:52:12 +02:00
wizard Removed version="7.0" from form views 2014-06-12 09:09:59 +02:00
__init__.py
__openerp__.py [IMP] Updated website urls on modules and info page 2014-08-26 21:40:18 +02:00
_common.py [FIX] base: support float rounding with rounding_method=UP (ceiling) 2014-10-22 14:28:22 +02:00
partner.py [REF] *: change linked to server revision 4907. Removed deprecated 'view_load' attribute + removed duplicated first argument of property fields which is replaced with 'relation' argument in case where it is really needed (relational fields): indeed this first argument was totally useless for property of float type (for example). 2013-06-24 11:05:15 +02:00
partner_view.xml [IMP] made independant purchase pricelist in supplier 2013-05-09 16:00:45 +05:30
pricelist.py [FIX] product: pricelist: multiple corrections in UoM-related conversions 2014-12-09 17:30:47 +01:00
pricelist_view.xml [IMP] product: usability improvement in pricelist 2014-11-28 15:50:57 +01:00
product.py [FIX] product: pricelist: multiple corrections in UoM-related conversions 2014-12-09 17:30:47 +01:00
product_data.xml [MERGE] forward port of branch 7.0 up to de07c64 2014-11-28 15:16:38 +01:00
product_demo.xml [IMP] Adapt mrp workflow and moves + Differ between Bose speakers and Custom Computer 2014-09-03 19:18:17 +02:00
product_image_demo.xml [IMP] Adapt mrp workflow and moves + Differ between Bose speakers and Custom Computer 2014-09-03 19:18:17 +02:00
product_pricelist_demo.yml [FIX] product : Improved the test cases. 2012-09-19 18:43:05 +05:30
product_report.xml [FIX]product: disable menu name come from report declaration.because it's called from wizard 2014-07-08 16:11:28 +05:30
product_view.xml [FIX] product: force empty view_id for action `product_variant_action` 2014-12-02 17:45:31 +01:00