This question has been flagged
3170 Views

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'    }])


Avatar
Discard
Hi,

It seems I can not edit a question I have asked in any way once it is saved!!!! stackoverflow allows this.

Any assistance?

On Fri, Jan 20, 2017 at 5:17 PM, Ermin Trevisan <trevi@twanda.com> wrote:

A new question Create a payment and apply it to an invoice using XMLRPC In Odoo 9 on Help has been posted. Click here to access the question :

See question

--
Ermin Trevisan


Sent by Odoo S.A. using Odoo.