Skip to content
Permalink
Browse files

[FIX] account,payment: instant payment post process

Fine-tuning of commit dd84943
  • Loading branch information...
jpp-odoo committed Mar 26, 2019
1 parent 11b1e12 commit 673592fd744709d4ed9a223623c1c781bc09fc10
Showing with 6 additions and 3 deletions.
  1. +1 −3 addons/account/models/account_payment.py
  2. +5 −0 addons/payment/models/account_payment.py
@@ -661,9 +661,7 @@ def action_validate_invoice_payment(self):
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 @@ def _create_payment_transaction(self, vals=None):

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.

0 comments on commit 673592f

Please sign in to comment.
You can’t perform that action at this time.