İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
4505 Görünümler

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
Vazgeç
En İyi Yanıt

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
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
1
Şub 21
4664
0
Mar 18
4134
1
Mar 15
7403
2
Mar 15
10280
1
Oca 23
4929