I did the following:
First I created the function:
Then I passed the following parameters:
def invoiceRegisterPayment(self,register_payment_row):
confirm_result = self.ODOO_OBJECT.execute_kw(
self.DATA,
self.UID,
self.PASS,
'account.payment',
'action_validate_invoice_payment',
register_payment_row)
return confirm_result
register_payment_row = [
[payment_id],
{
"active_id":invoice_id,
"active_ids":[invoice_id],
"active_model": "account.invoice",
"default_invoice_ids":[[4,invoice_id,None]],
"journal_type":"sale",
"lang":"en_US",
"search_disable_custom_filters": True,
"type": "out_invoice",
"tz": False,
"uid": 2
} ]
But it shows the following error: "This method should only be called to process a single invoice's payment."
This is the print of register_payment_row:
[[67], {'active_id': 119, 'active_ids': [119], 'active_model': 'account.invoice', 'default_invoice_ids': [4, 119, None], 'journal_type': 'sale', 'lang': 'en_US', 'search_disable_custom_filters': True, 'type': 'out_invoice', 'tz': False, 'uid': 2}]