Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
989 Vistas

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
Descartar
Autor Mejor respuesta

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
Descartar
Autor

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

Mejor respuesta

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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
3
feb 23
4593
1
ene 23
2914
0
ene 23
1554
1
feb 24
1212
1
dic 23
1901