Skip to content

Commit

Permalink
[FIX] account_ux: when an account move line don´t have account no che…
Browse files Browse the repository at this point in the history
…ck company

Ticket: 63705
  • Loading branch information
pablohmontenegro committed Jul 18, 2023
1 parent 716f419 commit 0972c78
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion account_ux/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def _compute_invoice_date_due(self):
@api.constrains('state')
def _check_company_on_lines(self):
for move in self.filtered(lambda x: x.state == 'posted'):
if any(line.account_id.company_id != self.company_id for line in self.line_ids):
if any(line.account_id.company_id != self.company_id for line in self.line_ids.filtered(lambda x: x.account_id)):
raise UserError(_("There is almost one account in the journal entry of this move that belongs to a company that "
"is different to the company of the move (id: %s)" % (move.id)))

Expand Down

0 comments on commit 0972c78

Please sign in to comment.