[FIX] account,payment: instant payment post process
Fine-tuning of commit dd8494313f
closes odoo/odoo#32124
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
This commit is contained in:
@@ -661,9 +661,7 @@ class account_payment(models.Model):
|
||||
if any(len(record.invoice_ids) != 1 for record in self):
|
||||
# For multiple invoices, there is account.register.payments wizard
|
||||
raise UserError(_("This method should only be called to process a single invoice's payment."))
|
||||
res = self.post()
|
||||
self.mapped('payment_transaction_id').filtered(lambda x: x.state == 'done' and not x.is_processed)._post_process_after_done()
|
||||
return res
|
||||
return self.post()
|
||||
|
||||
def _create_payment_entry(self, amount):
|
||||
""" Create a journal entry corresponding to a payment, if the payment references invoice(s) they are reconciled.
|
||||
|
||||
@@ -71,6 +71,11 @@ class AccountPayment(models.Model):
|
||||
|
||||
return transactions
|
||||
|
||||
def action_validate_invoice_payment(self):
|
||||
res = super(AccountPayment, self).action_validate_invoice_payment()
|
||||
self.mapped('payment_transaction_id').filtered(lambda x: x.state == 'done' and not x.is_processed)._post_process_after_done()
|
||||
return res
|
||||
|
||||
@api.multi
|
||||
def post(self):
|
||||
# Post the payments "normally" if no transactions are needed.
|
||||
|
||||
Reference in New Issue
Block a user