This question has been flagged

here is my code


$account_invoice_line_tax = $models->execute_kw($db,$uid,$password,
'account.invoice.line.tax', 
'create', 
    array(
        array(
            'invoice_line_id'=>$invoice_line_id,
            'tax_id'=>$tax_id
        )
    )
);

result 



Array ( [faultCode] => 2 [faultString] => Object account.invoice.line.tax doesn't exist )


I have tired to read from this https://www.odoo.com/th_TH/forum/help-1/question/how-can-i-add-taxes-to-invoice-lines-using-api-xmlrpc-84758 Can you give php example ?

Avatar
Discard
Best Answer

Hi, jimmy


Regarding Above Query:

Firstly you are using wrong model for set tax inside the "Account Invoice Line".

"invoice_line_tax_ids" field (which is many2many type) inside "account.invoice.line" helps to store taxes inside the account invoice line.
So in PHP you can set taxes inside invoice line using code which is present inside below file,

https://gist.github.com/ashish-webkul/c0123088a3e9142580ee62f96bee1148 

For PHP please use below "xmlrpc.inc" library,

https://github.com/gggeek/phpxmlrpc/blob/php51/lib/xmlrpc.inc 


Feel free to ask in case you have any doubt related to the above code.


Thanks,
Ashish Singh (Team Lead)
Webkul Software Private Limited


Avatar
Discard