I cant seems to register payment using the api, got the error "This method should only be called to process a single invoice's payment". Anyway there is only single invoice id. I set the has_invoices = true and invoices_id to a single invoice id. But seems like when i use to api to read the record, it still show as has_invoices as false and invoice_id is blank after creation.
@app.route("/create_payment")
def create_payment():
payment_date = request.args.get("payment_date")
invoice_ids = int(request.args.get("invoice_ids"))
amount = request.args.get("amount")
payment_method_id = request.args.get("payment_method_id")
communication = request.args.get("communication")
payment_id = models.execute_kw(db, uid, password, 'account.payment', 'create', [{
'payment_date': payment_date,
'has_invoices': True,
'invoice_ids': [invoice_ids],
'amount': amount,
'payment_method_id': payment_method_id,
'communication': communication,
'currency_id': 38,
'journal_id': 8,
'partner_type': 'customer',
'partner_id': 92,
'payment_type': 'inbound'
}]) models.execute_kw(db, uid, password, 'account.payment', 'action_validate_invoice_payment', [payment_id]) return jsonify(payment_id)