Skip to content

Commit

Permalink
'Quoted qty' is now positive. Explain UoM feature drop.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lionel Sausin committed Sep 10, 2015
1 parent 3693df9 commit 7bff33f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
10 changes: 10 additions & 0 deletions stock_available_sale/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ Known issues / Roadmap
This module does not warn salespersons when the quantity available to promise
is insufficient to deliver a sale order line.

Changed features
----------------
The quoted quantity is now returned as a positive value, whereas it was returned as a negative value before v8.0.
This change was made to ensure consistency with the standard, which used to present outgoing quantities as negative numbers until v8.0, and now presents them as positive numbers instead.

Removed features
----------------
Previous versions of this module used to let programmers demand to get the quoted quantity in an arbitrary Unit of Measure using the `context`. This feature was present in the standard computations too until v8.0, but it has been dropped from the standard from v8.0 on.
For the sake of consistency the quoted quantity is now always reported in the product's main Unit of Measure too.

Credits
=======

Expand Down
2 changes: 1 addition & 1 deletion stock_available_sale/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

{
'name': 'Quotations in quantity available to promise',
'version': '8.0.2.1',
'version': '8.0.3.0',
"author": u"Numérigraphe,Odoo Community Association (OCA)",
'category': 'Hidden',
'depends': [
Expand Down
2 changes: 1 addition & 1 deletion stock_available_sale/models/product_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def _get_quoted_qty(self):
product_id = group['product_id'][0]
uom_id = group['product_uom'][0]
# Compute the quoted quantity
# Convert to the product's UoM
# Convert to the product's UoM
# Rounding is OK since small values have not been squashed before
results[product_id] = (
results.get(product_id, 0.0) +
Expand Down
12 changes: 3 additions & 9 deletions stock_available_sale/test/quoted_qty.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
pricelist_id: product.list0
- The quoted qty should match the single quotation
- !assert {model: product.product, id: product.product_product_10, string: "Check quoted_qty"}:
- quoted_qty == -107.0
- quoted_qty == 107.0

- Enter another Quotation
- !record {model: sale.order, id: order2}:
Expand All @@ -50,17 +50,11 @@
pricelist_id: product.list0
- The quoted qty should match the total of the quotations
- !assert {model: product.product, id: product.product_product_10, string: "Check quoted quantity"}:
- quoted_qty == -720.0
- quoted_qty == 720.0
- Use the context to report in another UoM
- !assert {model: product.product, id: product.product_product_10, string: "Check in other UoM", context: "{'uom': ref('thousand')}"}:
- quoted_qty == -0.72
- Use the context to report in the default UoM
- !assert {model: product.product, id: product.product_product_10, string: "Check in False UoM", context: "{'uom': False}"}:
- quoted_qty == -720.0

- Confirm one of the Quotations
- !workflow {model: sale.order, action: order_confirm, ref: order1}
- The quoted qty should match the remaining quotation
- !assert {model: product.product, id: product.product_product_10, string: "Check quoted quantity"}:
- quoted_qty == -613.0

- quoted_qty == 613.0

0 comments on commit 7bff33f

Please sign in to comment.