Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
2792 มุมมอง

Hello,

I'm writing a script to import products and their details on Odoo. 

I can import products and their details correctly, but I want to include their values in two languages (en_US and it_IT). 

Is there a way, via XMLRPC, to add translations while creating records?


What I want would be really similar to this:


self.write('product.attribute.value', attribute_value_id, {
'name': [
['en_US', attribute_value_name + " in English"],
['it_IT', attribute_value_name + " but in Italian"]
]
})

Googled a bit and can't find anything working or relevant. I'm using Odoo 16.

Thanks in advance!.
อวตาร
ละทิ้ง
ผู้เขียน

up

คำตอบที่ดีที่สุด

Hi, if someone are still looking how to update translated field here is the right code to use using update_field_translations :

odoo = xmlrpc.client.ServerProxy('{}/xmlrpc/2/object'.format(ODOO_URL)
odoo.execute_kw(db, username, password, 'product.template', 'update_field_translations', [[$yourID$], 'description_sale', {
"it_IT": "IT desc",
"en_US": "En desc"
}])



อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
3
ก.ค. 25
768
1
ส.ค. 23
13202
0
มิ.ย. 20
61
2
พ.ค. 25
5487
Create invoice via xmlrpc แก้ไขแล้ว
1
พ.ย. 22
3253