Skip to content

Commit

Permalink
[FIX] sale_commission_product_criteria: 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 589d071 commit 0bd3668
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sale_commission_product_criteria/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@ def _compute_amount(self):
for line in self:
if line.commission_id and line.commission_id.commission_type == "product":
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
else:
line.amount = amount
else:
res = super(AccountInvoiceLineAgent, line)._compute_amount()
return res

0 comments on commit 0bd3668

Please sign in to comment.