Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
4799 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
úno 21
5276
0
bře 18
4740
1
bře 15
8275
2
bře 15
11082
1
led 23
5583