I'm using the below PHP code to attach a payment to a customer / partner
$payment_id = $odoo->get('account.payment', 'create', array(array( 'date' => date('Y-m-d', $invoice['date']), 'extract_state' => 'no_extract_requested', 'journal_id' => 8, 'partner_type' => 'customer', 'payment_type' => 'inbound', 'partner_id' => $invoice['partner_id'], 'amount' => abs($invoice['amount']) )));
This appears on the accounting -> Customers -> Payment screen absolutely fine. I manually approve / post this payment.
When looking at the partner account though, there is no payment visible on their account.
What am I missing?