Skip to content

Commit

Permalink
wip tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyasProgrammer committed Aug 15, 2023
1 parent d443237 commit d7a0e01
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def test_commission_domain(self):
so.order_line.agent_ids._compute_amount()
invoice.line_ids.agent_ids._compute_amount()

# discount net_amount
# discount net_amount percentage
self.demo_agent_rules_restricted.commission_id = (
self.demo_commission_rules_restrict
)
Expand All @@ -245,12 +245,21 @@ def test_commission_domain(self):
so.order_line.discount = 20
so.recompute_lines_agents()
so.action_confirm()
so.order_line.agent_ids.commission_id.item_ids.commission_type = "percentage"
so.order_line.agent_ids._compute_amount()
invoice.line_ids.agent_ids.commission_id = self.demo_commission_rules_restrict
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()

# no commission items
self.demo_commission_rules_restrict.item_ids.unlink()
so = self._create_sale_order(self.pt_11.product_variant_id, self.azure)
so.recompute_lines_agents()
so.action_confirm()
so.order_line.agent_ids._compute_amount()
invoice.line_ids.agent_ids._compute_amount()

def _create_sale_order(self, product, partner):
return self.sale_order_model.create(
{
Expand Down

0 comments on commit d7a0e01

Please sign in to comment.