From d3c81921a61a515e1bf44306b513ae00821abe48 Mon Sep 17 00:00:00 2001 From: Ilyas Date: Fri, 18 Aug 2023 10:54:53 +0200 Subject: [PATCH] upd --- ...test_sale_commission_product_criteria_domain.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sale_commission_product_criteria_domain/tests/test_sale_commission_product_criteria_domain.py b/sale_commission_product_criteria_domain/tests/test_sale_commission_product_criteria_domain.py index 2e632a8f7..96ef954cf 100644 --- a/sale_commission_product_criteria_domain/tests/test_sale_commission_product_criteria_domain.py +++ b/sale_commission_product_criteria_domain/tests/test_sale_commission_product_criteria_domain.py @@ -190,6 +190,8 @@ def test_commission_domain(self): invoice.recompute_lines_agents() so.order_line.agent_ids._compute_amount() invoice.line_ids.agent_ids._compute_amount() + self.assertEqual(so.order_line.agent_ids.amount, 150) + self.assertEqual(invoice.line_ids.agent_ids.amount, 150) # tst_partner = so.partner_id.copy({}) @@ -215,6 +217,8 @@ def test_commission_domain(self): invoice.recompute_lines_agents() so.order_line.agent_ids._compute_amount() invoice.line_ids.agent_ids._compute_amount() + self.assertEqual(so.order_line.agent_ids.amount, 20) + self.assertEqual(invoice.line_ids.agent_ids.amount, 20) # computes was modified to consider new commission type: product_restricted self.product_5.commission_free = True @@ -225,6 +229,8 @@ def test_commission_domain(self): invoice.recompute_lines_agents() so.order_line.agent_ids._compute_amount() invoice.line_ids.agent_ids._compute_amount() + self.assertEqual(so.order_line.agent_ids.amount, 0) + self.assertEqual(invoice.line_ids.agent_ids.amount, 0) # computes was modified to consider new commission type: product_restricted self.azure.agent_ids.commission_id = self.demo_commission_rules @@ -235,6 +241,8 @@ def test_commission_domain(self): invoice.recompute_lines_agents() so.order_line.agent_ids._compute_amount() invoice.line_ids.agent_ids._compute_amount() + self.assertEqual(so.order_line.agent_ids.amount, 0) + self.assertEqual(invoice.line_ids.agent_ids.amount, 0) # computes was modified to consider new commission type: product_restricted so = self._create_sale_order(self.product_1, self.azure) @@ -244,6 +252,8 @@ def test_commission_domain(self): invoice.recompute_lines_agents() so.order_line.agent_ids._compute_amount() invoice.line_ids.agent_ids._compute_amount() + self.assertEqual(so.order_line.agent_ids.amount, 15) + self.assertEqual(invoice.line_ids.agent_ids.amount, 15) # discount net_amount percentage self.demo_agent_rules_restricted_spain.commission_id = ( @@ -262,6 +272,8 @@ def test_commission_domain(self): invoice.line_ids.agent_ids.commission_id.amount_base_type = "net_amount" invoice.line_ids.agent_ids.commission_id.item_ids.commission_type = "percentage" invoice.line_ids.agent_ids._compute_amount() + self.assertEqual(so.order_line.agent_ids.amount, 0) + self.assertEqual(invoice.line_ids.agent_ids.amount, 0) # no commission items self.demo_commission_rules_restrict.item_ids.unlink() @@ -270,6 +282,8 @@ def test_commission_domain(self): so.action_confirm() so.order_line.agent_ids._compute_amount() invoice.line_ids.agent_ids._compute_amount() + self.assertEqual(so.order_line.agent_ids.amount, 0) + self.assertEqual(invoice.line_ids.agent_ids.amount, 0) def _create_sale_order(self, product, partner): return self.sale_order_model.create(