[FIX] account: invoices on unmatched payment
Fine tuning of this commit:69c41c7When cancelling a payment, the remove_move_reconcile function was called and it removed the payment from the invoice and in the payment history, only the validated payments were kept. This commit keeps the behavior before this commit:69c41c7opw:691692
This commit is contained in:
@@ -991,7 +991,7 @@ class AccountMoveLine(models.Model):
|
||||
rec_move_ids = self.env['account.partial.reconcile']
|
||||
for account_move_line in self:
|
||||
for invoice in account_move_line.payment_id.invoice_ids:
|
||||
if account_move_line in invoice.payment_move_line_ids:
|
||||
if invoice.id == self.env.context.get('invoice_id') and account_move_line in invoice.payment_move_line_ids:
|
||||
account_move_line.payment_id.write({'invoice_ids': [(3, invoice.id, None)]})
|
||||
rec_move_ids += account_move_line.matched_debit_ids
|
||||
rec_move_ids += account_move_line.matched_credit_ids
|
||||
|
||||
@@ -59,7 +59,7 @@ var ShowPaymentLineWidget = form_common.AbstractField.extend({
|
||||
var payment_id = parseInt($(this).attr('payment-id'))
|
||||
if (payment_id !== undefined && payment_id !== NaN){
|
||||
new Model("account.move.line")
|
||||
.call("remove_move_reconcile", [payment_id])
|
||||
.call("remove_move_reconcile", [payment_id, {'invoice_id': self.view.datarecord.id}])
|
||||
.then(function (result) {
|
||||
self.view.reload();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user