[FIX] sale_timesheet: fix the upsell activity creation

Currently the 'upsell' activity generated when the delivered quantity
of the SOL is >= 100% instead of > 100%

so in this commit, if SOL is > 100% then only the upsell activity should
be generated. also fix the upsell_threshold value to fix the test case.

Taskid: 2642872
Closes: #76312
X-original-commit: ee9082b9d93b4f98a9a13694fb3b803cd7d1ac6c
Part-of: odoo/odoo#76967
This commit is contained in:
Barad Mahendra
2021-09-22 15:08:55 +00:00
parent 2119232747
commit 6b8429f4c2
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -89,7 +89,7 @@ class SaleOrder(models.Model):
sol.qty_delivered,
sol.product_uom_qty * (sol.product_id.service_upsell_threshold or 1.0),
precision_digits=precision
) >= 0
) > 0
)
def action_view_timesheet(self):
@@ -25,7 +25,7 @@ class TestUpsellWarning(TestCommonSaleTimesheet):
"""
# 1) Configure the upsell warning in prepaid service product
self.product_order_timesheet1.write({
'service_upsell_threshold': 0.6,
'service_upsell_threshold': 0.5,
})
# 2) Create SO with a SOL containing this updated product