summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2019-06-07 14:20:35 +0000
committerNicolas Martinelli <nim@odoo.com>2019-06-07 14:20:35 +0000
commita25f6e1b9617a04ccc517ed2e53429ca233ba728 (patch)
tree4b388f21b464e0da76b2b97acaca5d5aa57f8782 /addons
parent34ae29e68b4ecbb23eb2162109b79b50e6f97f60 (diff)
[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 d6ad22227cc7b3f36ac9914cce4f8a1f0a0f36a2. opw-1982020 closes odoo/odoo#33991 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/sale/models/sale.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py
index 9fca947f6f1..fddcfed99b7 100644
--- a/addons/sale/models/sale.py
+++ b/addons/sale/models/sale.py
@@ -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