diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 559d06e6d1d..0aacbbdc5b5 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -1270,7 +1270,8 @@ class AccountMove(models.Model): if move.is_invoice(include_receipts=True) and move.state == 'posted': if currency.is_zero(move.amount_residual): - if all(payment.is_matched for payment in move._get_reconciled_payments()): + reconciled_payments = move._get_reconciled_payments() + if not reconciled_payments or all(payment.is_matched for payment in reconciled_payments): new_pmt_state = 'paid' else: new_pmt_state = move._get_invoice_in_payment_state() diff --git a/addons/point_of_sale/models/account_move.py b/addons/point_of_sale/models/account_move.py index e66bc2e188d..bda9c411782 100644 --- a/addons/point_of_sale/models/account_move.py +++ b/addons/point_of_sale/models/account_move.py @@ -17,11 +17,6 @@ class AccountMove(models.Model): stock_moves += invoice.sudo().mapped('pos_order_ids.picking_ids.move_lines').filtered(lambda x: x.state == 'done' and x.location_id.usage == 'customer') return stock_moves - def _compute_amount(self): - super(AccountMove, self)._compute_amount() - pos_invoices = self.filtered(lambda i: i.move_type in ['out_invoice', 'out_refund'] and i.pos_order_ids) - for invoice in pos_invoices: - invoice.payment_state = 'paid' def _get_invoiced_lot_values(self): self.ensure_one()