Skip to content
Snippets Groups Projects
Commit b00d070b authored by Goffin Simon's avatar Goffin Simon
Browse files

[FIX] sale: delivred qty in SO line not updated

When making a account.analytic.line(aal) which matches with a SO line with
a product set with invoice_policy != 'cost' then these aal have to be linked
to this SO line.

opw:658821
parent 5b2e7943
Branches
Tags
No related merge requests found
......@@ -84,10 +84,11 @@ class AccountAnalyticLine(models.Model):
# Use the existing SO line only if the unit prices are the same, otherwise we create
# a new line
for line in so_lines:
if line.price_unit == self._get_invoice_price(line.order_id):
if line.product_id.invoice_policy != 'cost' or (line.product_id.invoice_policy == 'cost' and line.price_unit == self._get_invoice_price(line.order_id)):
result.update({'so_line': line.id})
so_line = line
break
else:
# This will trigger the creation of a new SO line
so_line = False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment