Skip to content

Commit

Permalink
[FIX] account_invoice_check_total: compatibility with hr_expense
Browse files Browse the repository at this point in the history
hr_expense creates moves of type in_invoice, but
of course does not set the check_total field.
So we skip the check if the move is linked to an
expense sheet. This is a bit of a hack but a dedicated
glue module sounds overkill.
  • Loading branch information
sbidoul committed Sep 11, 2024
1 parent 580836c commit aaf8bb0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions account_invoice_check_total/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ def action_post(self):
if (
self.env.user.has_group(GROUP_AICT)
and inv.move_type in ("in_invoice", "in_refund")
# hack for compatibility with hr_expense without depending on it
and not getattr(inv, "expense_sheet_id", None)
and float_compare(
inv.check_total,
inv.amount_total,
Expand Down

0 comments on commit aaf8bb0

Please sign in to comment.