تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
3741 أدوات العرض

Hello, I need to update the field "amount_tax" in the invoices (account.invoice).

I tried to set the field at the creation of the invoice (using API), but the "amount_tax" still remains 0.00 so I decided to insert the invoice lines after the creation of the invoice but the "amount_tax" is not recalculated automatically.

Then, I tried to update the invoices via API after the insertion of the lines with this code (amount_tax value is for example):

sock.execute(dbname, uid, pwd, 'account.invoice', 'write', invoice_id, {'amount_tax': '50'})

But i get this error:

No value found for account.invoice('372',).currency_id: ''> 

('372' is the invoice id)

Is there a better way to do this?

Is the update code wrong?


Any help is appreciated

الصورة الرمزية
إهمال

check in script for invoice_id or print invoice_id before use.

الكاتب

Thank you, the error was in the invoice_id variable...sorry for this question

المنشورات ذات الصلة الردود أدوات العرض النشاط
2
يوليو 19
4145
0
مايو 19
4206
1
يونيو 17
3654
1
فبراير 25
1610
0
نوفمبر 24
1425