Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
4666 Ansichten

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
Verwerfen
Beste Antwort

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
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
1
Feb. 21
4975
0
März 18
4400
1
März 15
7812
2
März 15
10601
1
Jan. 23
5237