Skip to content

Commit b8eb488

Browse files
committed
[15.0][FIX] hr_expense_advance_clearing: skip check clearing amount
1 parent cb9d523 commit b8eb488

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

hr_expense_advance_clearing/models/hr_expense_sheet.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ def _check_constraint_clearing_amount(self):
7171
and x.advance_sheet_residual <= 0.0
7272
and x.state in ["submit", "approve", "post"]
7373
)
74-
if sheets_x: # Advance Sheets with no residual left
74+
if sheets_x and not self.env.context.get("skip_check_clearing_amount", False):
75+
# Advance Sheets with no residual left
7576
raise ValidationError(
7677
_("Advance: %s has no amount to clear")
7778
% ", ".join(sheets_x.mapped("name"))

hr_expense_advance_clearing/wizard/account_payment_register.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ def _validate_over_return(self):
9696
)
9797

9898
def action_create_payments(self):
99+
self = self.with_context(skip_check_clearing_amount=True)
99100
if self._context.get("hr_return_advance", False):
100101
self._validate_over_return()
101102
self.expense_post_return_advance()

0 commit comments

Comments
 (0)