İçereği Atla
Menü
This question has been flagged
2 Cevaplar
1001 Görünümler

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 }


Avatar
Vazgeç
Üretici Best Answer

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?

Avatar
Vazgeç
Üretici

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

Best Answer

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'})

Avatar
Vazgeç
Related Posts Cevaplar Görünümler Aktivite
3
Şub 23
4593
1
Oca 23
2914
0
Oca 23
1554
1
Şub 24
1212
1
Ara 23
1903