From afad149eb8a542b39e9508a458d7aeb43aeb60ed Mon Sep 17 00:00:00 2001 From: Joseph Caburnay Date: Thu, 10 Oct 2019 11:45:35 +0000 Subject: [REF] *_sale_coupon: create coupon module This refactoring extracts parts of `sale_coupon` module to create a more generic module called `coupon`. This new module can be extended in different sales modules to implement functionalities specific to modules that extend it. --- addons/sale_coupon/tests/test_program_with_code_operations.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'addons/sale_coupon/tests/test_program_with_code_operations.py') diff --git a/addons/sale_coupon/tests/test_program_with_code_operations.py b/addons/sale_coupon/tests/test_program_with_code_operations.py index 92146c1d1f9..466eb9eabd2 100644 --- a/addons/sale_coupon/tests/test_program_with_code_operations.py +++ b/addons/sale_coupon/tests/test_program_with_code_operations.py @@ -18,7 +18,7 @@ class TestProgramWithCodeOperations(TestSaleCouponCommon): # In this case, it will generate the coupon for every partner. # Thus, we should ensure that if you leave the domain untouched, it generates a coupon for each partner # as hinted on the screen ('Match all records (X records)') - self.env['sale.coupon.generate'].with_context(active_id=self.code_promotion_program.id).create({ + self.env['coupon.generate.wizard'].with_context(active_id=self.code_promotion_program.id).create({ 'generation_type': 'nbr_customer', }).generate_coupon() self.assertEqual(len(self.code_promotion_program.coupon_ids), len(self.env['res.partner'].search([])), "It should have generated a coupon for every partner") @@ -28,7 +28,7 @@ class TestProgramWithCodeOperations(TestSaleCouponCommon): self.code_promotion_program.reward_type = 'discount' - self.env['sale.coupon.generate'].with_context(active_id=self.code_promotion_program.id).create({ + self.env['coupon.generate.wizard'].with_context(active_id=self.code_promotion_program.id).create({ 'generation_type': 'nbr_customer', 'partners_domain': "[('id', 'in', [%s])]" % (self.steve.id), }).generate_coupon() @@ -69,7 +69,7 @@ class TestProgramWithCodeOperations(TestSaleCouponCommon): def test_coupon_code_with_pricelist(self): # Test case: Generate a coupon (10% discount) and apply it on an order with a specific pricelist (10% discount) - self.env['sale.coupon.generate'].with_context(active_id=self.code_promotion_program_with_discount.id).create({ + self.env['coupon.generate.wizard'].with_context(active_id=self.code_promotion_program_with_discount.id).create({ 'generation_type': 'nbr_coupon', 'nbr_coupons': 1, }).generate_coupon() @@ -127,7 +127,7 @@ class TestProgramWithCodeOperations(TestSaleCouponCommon): 'promo_code': 'free_B_on_next_order', }) # 2. - self.p1 = self.env['sale.coupon.program'].create({ + self.p1 = self.env['coupon.program'].create({ 'name': 'Code for 10% on next order', 'discount_type': 'percentage', 'discount_percentage': 10.0, -- cgit v1.2.3