diff options
| author | Andrea Grazioso (agr-odoo) <agr@odoo.com> | 2020-04-10 09:04:40 +0000 |
|---|---|---|
| committer | Andrea Grazioso (agr-odoo) <agr@odoo.com> | 2020-04-10 12:54:00 +0000 |
| commit | c1c3764ec35b92b4c79203db4ee88e71c03892be (patch) | |
| tree | eb0945a34090b1a395b9b856c186ed28f1eeca16 | |
| parent | 0a1ed9be1e3757ed0fc7a8f52e382f77dfb4cd8e (diff) | |
[FIX] stock_account: avoid traceback on quantity zero
1. Install PoS and Accounting
2. In a product category activate the Inventory Valuation automated
3. Sell a quantity 0 of such product via POS
Traceback will occur when confirming the sale because the inventory
valuation do not handle zero quantity
opw-2206625
closes odoo/odoo#49417
X-original-commit: d501ddd1e80bc4e3ff90cd9b34eb43c27e55ff97
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
| -rw-r--r-- | addons/stock_account/models/product.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/addons/stock_account/models/product.py b/addons/stock_account/models/product.py index 4d80dc285c7..855d1b5e8ac 100644 --- a/addons/stock_account/models/product.py +++ b/addons/stock_account/models/product.py @@ -564,6 +564,8 @@ class ProductProduct(models.Model): :rtype: float """ self.ensure_one() + if not qty_to_invoice: + return 0.0 if not qty_to_invoice: return 0 |
