I was able to go through (https://www.odoo.com/forum/help-1/question/register-payment-using-xmlrpc-44048) and make a sales voucher after activating the voucher module. However, workflow('account.voucher', 'proforma_voucher', voucher_id) just does not work.
How can I achieve this? So far, what I have noted I can create a draft payment as follows:
# Fetch the invoice invoice = self.execute_kw('account.invoice', 'search_read', [[ ['number', '=', billRefNumber] ]])[0]
# Fetch the payment method payment_method = self.execute_kw('account.payment.method', 'search_read', [[ ['payment_type', '=', 'inbound'], ['code', '=', 'manual'] ]])[0]
# Get the journal index journal = self.execute_kw('account.journal', 'search_read', [[ ['code', '=', 'CSH1'] ]])[0]
# Create the draft payment payment_id = self.execute_kw('account.payment', 'create', [{ 'communication': 'Payment for %s' % invoice["display_name"].strip(), 'company_id': invoice["company_id"][0], 'partner_id': invoice["partner_id"][0], 'payment_method_id': payment_method["id"], 'journal_id': journal["id"], 'name': invoice["display_name"], 'partner_type': 'customer', 'amount': amount, 'payment_type': 'inbound' }])