Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
1000 Widoki

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 }


Awatar
Odrzuć
Autor Najlepsza odpowiedź

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?

Awatar
Odrzuć
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

Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
3
lut 23
4593
1
sty 23
2914
0
sty 23
1554
1
lut 24
1212
1
gru 23
1903