Skip to content
Snippets Groups Projects
Commit beeb83ca authored by Nicolas Martinelli's avatar Nicolas Martinelli
Browse files

[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: default avatarNicolas Martinelli (nim) <nim@odoo.com>
parent 9359be0d
Branches
Tags
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment