[FIX] sale: recompute delivered qty

- Create a product A of type "Service", Invoice based on "Milestones",
Service Tracking "Create a task in a new project".
- Create a new SO with A, confirm.
- Go the to task associated to the SO, go to "Timesheets" tab, add an
entry
- In the SO, edit the delivered quantity
- Create invoice, validate

Back to the SO, delivered quantity is reset to 0.

We make sure to filter out SO lines which have a delivered quantity set
manually.

Introduced by d6ad22227c.

opw-1982020

closes odoo/odoo#33991

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
Nicolas Martinelli
2019-06-07 14:20:35 +00:00
parent 34ae29e68b
commit a25f6e1b96
+3
View File
@@ -1246,6 +1246,9 @@ class SaleOrderLine(models.Model):
""" Compute and write the delivered quantity of current SO lines, based on their related
analytic lines.
"""
# The delivered quantity of Sales Lines in 'manual' mode should not be erased
self = self.filtered(lambda sol: sol.product_id.service_type != 'manual')
# avoid recomputation if no SO lines concerned
if not self:
return False