Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyasProgrammer committed Aug 18, 2023
1 parent 42816a9 commit 5a07883
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def _get_commission_items(self, commission, product):
# Module specific mod:
if self.object_id._name == "sale.order.line":
partner = self.object_id.order_id.partner_id
elif self.object_id._name == "account.invoice.line":
elif self.object_id._name == "account.move.line":
partner = self.object_id.partner_id
else:
partner = False
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def test_commission_domain_demo_cases(self):
so.order_line.agent_ids._compute_amount()
invoice.line_ids.agent_ids._compute_amount()
self.assertEqual(so.order_line.agent_ids.fixed_amount, 20)
self.assertEqual(invoice.line_ids.agent_ids.amount, 20)

# Azure Spain Customizable Desk (CONFIG) - Product Template
so = self._create_sale_order(
Expand All @@ -105,6 +106,7 @@ def test_commission_domain_demo_cases(self):
so.order_line.agent_ids._compute_amount()
invoice.line_ids.agent_ids._compute_amount()
self.assertEqual(so.order_line.agent_ids.percent_amount, 5)
self.assertEqual(invoice.line_ids.agent_ids.amount, 50)

# Azure Spain Variant: Customizable Desk (CONFIG) (Steel, White) - Variant
so = self._create_sale_order(self.product_4, self.azure)
Expand All @@ -115,6 +117,7 @@ def test_commission_domain_demo_cases(self):
so.order_line.agent_ids._compute_amount()
invoice.line_ids.agent_ids._compute_amount()
self.assertEqual(so.order_line.agent_ids.percent_amount, 15)
self.assertEqual(invoice.line_ids.agent_ids.amount, 150)

# Deco Italy - All products
so = self._create_sale_order(self.product_product_25, self.deco)
Expand All @@ -125,6 +128,7 @@ def test_commission_domain_demo_cases(self):
so.order_line.agent_ids._compute_amount()
invoice.line_ids.agent_ids._compute_amount()
self.assertEqual(so.order_line.agent_ids.fixed_amount, 10)
self.assertEqual(invoice.line_ids.agent_ids.amount, 10)

def test_commission_domain(self):
# group must have commission of CI
Expand Down

0 comments on commit 5a07883

Please sign in to comment.