summaryrefslogtreecommitdiff
path: root/addons/purchase_stock
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2020-11-20 14:31:42 +0000
committerNicolas Martinelli <nim@odoo.com>2020-11-20 14:36:37 +0000
commitbeeb83ca53c52dc189faaff4d76711bbcf24a08c (patch)
tree906f2df21592f7ec2ad70ffc9ab81523e75bb9cb /addons/purchase_stock
parent9359be0d4be946d9b20ba85ea26312b45a8c7da3 (diff)
[FIX] purchase_stock: fix price difference
1. Create a storable product 2. Set the category: Costing - Method: First In First Out (FIFO) - Inventory Valuation: Automated - Price Difference Account: Price different accounts. 3. Create a vendor bill with the product and the quantity set as 0, and set a tax 4. Post the vendor Bill A ZeroDivision error is raised. opw-2375464 closes odoo/odoo#62104 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons/purchase_stock')
-rw-r--r--addons/purchase_stock/models/account_invoice.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/purchase_stock/models/account_invoice.py b/addons/purchase_stock/models/account_invoice.py
index 02935d55a16..6731c3c05b0 100644
--- a/addons/purchase_stock/models/account_invoice.py
+++ b/addons/purchase_stock/models/account_invoice.py
@@ -116,7 +116,7 @@ class AccountMove(models.Model):
price_unit = line.price_unit * (1 - (line.discount or 0.0) / 100.0)
- if line.tax_ids:
+ if line.tax_ids and line.quantity:
# We do not want to round the price unit since :
# - It does not follow the currency precision
# - It may include a discount