Hi,
If you are creating invoice, you should take note that the account.invoice has a compulsory field of account_id and the account.invoice.line has a compulsory field of account_id, but of them must have a value when trying to create.
The payment module, just has journal, so you might not really have to worry about account_id, so your account_id issue is coming from account.invoice and account.invoice.line
This might help:
account_inv = self.env['account.invoice'].create({
'partner_id': partner_id.id,
'journal_id': journal_id.id,
'origin': sale_order.name,
'account_id': your_account_id.id,
'invoice_line_ids': [(0, 0, {'product_id': product_id, 'name': name,
'product_uom_qty': product_uom_qty,
'price_unit': price,
'account_id':account_id.id,
}
)],
})
This error sometime come because you create relational field with same name and different relation model
Post your Code and we will be able to help you