跳至内容
菜单
此问题已终结

For some reason I can not get the product-template translation to work.  The python code does send the data to the Odoo server succesfully.  However I can only insert the english text alone...   When inserting the different languages Odoo does not seem to parse the string out.  Any ideas of what I am missing would be greatly appreciated!


model = 'product.template'

method = 'create'


barcode =  '12345678'


en_text = "English Name"

es_text = "Espanola Nombre"

de_text = "Deutscher Name"


name =  { 'en_US' : en_text, 'es_CL' : es_text, 'de_DE' : de_text }


形象
丢弃
编写者 最佳答案

Thank you for the reply.


However, this is for a data exchange interface through the api from Arena PLM. To that end I need to have the interface coming from Arena fully populate the product template....


... any other ideas on this?

形象
丢弃
编写者

Thank you for the link....

Here is my solution based on that... ...note: 'name' is the field to be updated. The Id is the actual databaseid of the record to be updated..... ....so this turns out to be a two step solution. Insert a new record and using that recordid (id below) do an update to set the different languages.
operation2.execute_kw(db, internalID2, password, 'product.template', 'update_field_translations', [[id], 'name', {
"en_US": en_text,
"es_CL": es_text,
"de_DE": de_text
}])

Thanks again

最佳答案

Hello Markus,

Try to first "create" the product.

Then use method "write" for each lang. To define the lang use the context (example : context = {'lang': 'es_CL'})

形象
丢弃
相关帖文 回复 查看 活动
3
2月 23
4638
1
1月 23
2963
0
1月 23
1594
1
2月 24
1265
1
12月 23
1936