Skip to content

Commit

Permalink
[FIX] hr_expense_invoice: Change _validate_expense_invoice() function…
Browse files Browse the repository at this point in the history
… to use amount_total from invoices.

If residual amount from invoice is not the same, it should not show an error.

TT40175
  • Loading branch information
victoralmau committed Oct 26, 2022
1 parent e53f60a commit 4401713
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hr_expense_invoice/models/hr_expense_sheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def _validate_expense_invoice(self, expense_lines):
if any(invoices.filtered(lambda i: i.state != 'open')):
raise UserError(_('Vendor bill state must be Open'))
expense_amount = sum(expense_lines.mapped('total_amount'))
invoice_amount = sum(invoices.mapped('residual'))
invoice_amount = sum(invoices.mapped('amount_total'))
# Expense amount must equal invoice amount
if float_compare(expense_amount, invoice_amount, precision) != 0:
raise UserError(
Expand Down

0 comments on commit 4401713

Please sign in to comment.