Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
4804 Weergaven

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
Annuleer
Beste antwoord

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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
feb. 21
5276
0
mrt. 18
4741
1
mrt. 15
8275
2
mrt. 15
11083
1
jan. 23
5585