Open luke92 opened 2 years ago
Hi, I think I had once a similar issue and as I remember, you should use a different column for this, or add this tax to the product at first. I'll try to find some time on the weekend to check it.
Check this example with purchase order: PortaCapena.OdooJsonRpcClient.Example/OdooClientTests.cs - L654
Hi, I think I had once a similar issue and as I remember, you should use a different column for this, or add this tax to the product at first. I'll try to find some time on the weekend to check it.
Check this example with purchase order: PortaCapena.OdooJsonRpcClient.Example/OdooClientTests.cs - L654
Thanks Patrick!
I tried what you mention (even with your new column too) but it doesn't work
@patricoos I have a solution for this!
Here is my solution https://github.com/luke92/OdooNetFramework/blob/main/OdooIntegration/OdooIntegration.ConsoleApp/Many2ManyHelpers/OdooMany2ManyService.cs
Basicallly i authenticate with {baseUrl}/web/session/authenticate
Sending a json for authenticate and get session_id
{"jsonrpc":"2.0","params":{"db":"database","login":"username","password":"pass"}}
And then send a json structure to this url: {baseUrl}/web/dataset/call_kw
{ "jsonrpc": "2.0", "method": "call", "params": { "args": [ [ 60191 ], { "invoice_line_tax_ids": [ [ 6, false, [ 3 ] ] ] } ], "model": "account.invoice.line", "method": "write", "kwargs": { } }, "id": 12 }
The trick is replace the content of property args
Also for invoices, is necessary add taxline to invoice (add taxes in invoice line not generate taxes for invoice)
Congratulations! Good job, luke92 In the future, I will implement web client to my library, based on your example Thanks a lot!
Hi, i have a problem for write some fields that are many2many fields
In this case, i'm creating a Invoice That invoice has invoice lines where each line has an array of taxes lines Using the library i set the tax ids but after create the invoice line the taxes not appear
This is an example of Invoice created from ODOO V12 using web browser
![image](https://user-images.githubusercontent.com/1220217/160408686-8d18be5e-3ea7-454f-b365-784089694c62.png)
And this is an example of Invoice created from ODOO V12 using library PortaCapena![image](https://user-images.githubusercontent.com/1220217/160409017-2085039b-ac43-4eb5-9535-91d003effc26.png)
I'm using this table "account.invoice"
with one2many relation to "account.invoice.line"
Then i set the tax_ids for this invoice lines in field "invoice_line_tax_ids" (This field is a many2many field type)
![image](https://user-images.githubusercontent.com/1220217/160409996-202271af-447b-4773-a69d-5587d3a32f5d.png)
I'm setting the tax_id correctly
This is my code (My repo is here https://github.com/luke92/OdooNetFramework) The variable taxesId is getting from the product model First i create the invoice
After that i save each invoice line setting the id of invoice
![image](https://user-images.githubusercontent.com/1220217/160410791-1064e86b-6d8a-45ba-b856-165ab95b693e.png)
How can i save the "account.invoice.line" with "invoice_line_tax_ids" ?
In case of doubt, I am at your disposal
Thanks, Regards,