From 6b8429f4c2b126e773002d46f91016ec273a4f57 Mon Sep 17 00:00:00 2001 From: Barad Mahendra Date: Fri, 10 Sep 2021 09:59:57 +0000 Subject: [PATCH] [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 --- addons/sale_timesheet/models/sale_order.py | 2 +- addons/sale_timesheet/tests/test_upsell_warning.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/sale_timesheet/models/sale_order.py b/addons/sale_timesheet/models/sale_order.py index 9738c8e0c5d..827d43aa3d1 100644 --- a/addons/sale_timesheet/models/sale_order.py +++ b/addons/sale_timesheet/models/sale_order.py @@ -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): diff --git a/addons/sale_timesheet/tests/test_upsell_warning.py b/addons/sale_timesheet/tests/test_upsell_warning.py index f87c10ea2d4..8fc8f5f6584 100644 --- a/addons/sale_timesheet/tests/test_upsell_warning.py +++ b/addons/sale_timesheet/tests/test_upsell_warning.py @@ -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