From fe1a6b93e1b44c54050cdba5f8142557ba3f87e8 Mon Sep 17 00:00:00 2001 From: Eduard Brahas Date: Wed, 4 Sep 2024 17:18:50 +0200 Subject: [PATCH] [FIX]sale_coupon_delivery_auto_refresh: set context only for coupons --- sale_coupon_delivery_auto_refresh/models/sale_order.py | 4 +--- .../tests/test_sale_coupon_delivery_auto_refresh.py | 8 ++++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/sale_coupon_delivery_auto_refresh/models/sale_order.py b/sale_coupon_delivery_auto_refresh/models/sale_order.py index 70ab796c..63b3335b 100644 --- a/sale_coupon_delivery_auto_refresh/models/sale_order.py +++ b/sale_coupon_delivery_auto_refresh/models/sale_order.py @@ -9,9 +9,7 @@ def _auto_refresh_delivery(self): Override to change context value to refresh coupons after creation delivery line """ - self = self.with_context( - skip_auto_refresh_coupons=False, auto_refresh_delivery=True - ) + self = self.with_context(skip_auto_refresh_coupons=False) return super(SaleOrder, self)._auto_refresh_delivery() def _create_delivery_line(self, carrier, price_unit): diff --git a/sale_coupon_delivery_auto_refresh/tests/test_sale_coupon_delivery_auto_refresh.py b/sale_coupon_delivery_auto_refresh/tests/test_sale_coupon_delivery_auto_refresh.py index 7a9ea83d..6e919e14 100644 --- a/sale_coupon_delivery_auto_refresh/tests/test_sale_coupon_delivery_auto_refresh.py +++ b/sale_coupon_delivery_auto_refresh/tests/test_sale_coupon_delivery_auto_refresh.py @@ -30,16 +30,16 @@ def setUpClass(cls): } ) cls.env["ir.config_parameter"].sudo().set_param( - "delivery_auto_refresh.set_default_carrier", 1 + "delivery_auto_refresh.sale_auto_assign_carrier_on_create", 1 ) cls.env["ir.config_parameter"].sudo().set_param( - "delivery_auto_refresh.auto_void_delivery_line", 1 + "delivery_auto_refresh.sale_auto_void_delivery_line", 1 ) cls.env["ir.config_parameter"].sudo().set_param( - "delivery_auto_refresh.refresh_after_picking", 1 + "delivery_auto_refresh.sale_refresh_delivery_after_picking", 1 ) cls.env["ir.config_parameter"].sudo().set_param( - "delivery_auto_refresh.auto_add_delivery_line", 1 + "delivery_auto_refresh.sale_auto_add_delivery_line", 1 ) coupon_program_form = Form( cls.env["coupon.program"],