Skip to content

Commit

Permalink
[FIX] sale_commission_product_criteria_domain: consider credit note
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyasProgrammer authored and toita86 committed Jul 1, 2024
1 parent 0bd3668 commit 10dea70
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sale_commission_product_criteria/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def _compute_amount(self):
inv_line.product_id,
inv_line.quantity,
)
if line.invoice_id.move_type == 'out_refund':
if line.invoice_id.move_type == "out_refund":
line.amount = -amount

Check warning on line 29 in sale_commission_product_criteria/models/account_move.py

View check run for this annotation

Codecov / codecov/patch

sale_commission_product_criteria/models/account_move.py#L29

Added line #L29 was not covered by tests
else:
line.amount = amount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@ def _compute_amount(self):
and line.commission_id.commission_type == "product_restricted"
):
inv_line = line.object_id
line.amount = line._get_single_commission_amount(
amount = line._get_single_commission_amount(
line.commission_id,
inv_line.price_subtotal,
inv_line.product_id,
inv_line.quantity,
)
if line.invoice_id.move_type == "out_refund":
line.amount = -amount

Check warning on line 29 in sale_commission_product_criteria_domain/models/account_invoice_line_agent.py

View check run for this annotation

Codecov / codecov/patch

sale_commission_product_criteria_domain/models/account_invoice_line_agent.py#L29

Added line #L29 was not covered by tests
else:
line.amount = amount
else:
res = super(AccountInvoiceLineAgent, line)._compute_amount()
return res

0 comments on commit 10dea70

Please sign in to comment.