diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index 8486397b300..b7a885ef53e 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -223,7 +223,7 @@ class AccountInvoice(models.Model): for line in self.move_id.line_ids.filtered(lambda l: l.account_id.id == self.account_id.id): payment_lines.update(line.mapped('matched_credit_ids.credit_move_id.id')) payment_lines.update(line.mapped('matched_debit_ids.debit_move_id.id')) - self.payment_move_line_ids = self.env['account.move.line'].browse(list(payment_lines)) + self.payment_move_line_ids = self.env['account.move.line'].browse(list(payment_lines)).sorted() name = fields.Char(string='Reference/Description', index=True, readonly=True, states={'draft': [('readonly', False)]}, copy=False, help='The name that will be used on account move lines')