跳至內容
選單
此問題已被標幟
1 回覆
1985 瀏覽次數

Hi,

I'm calling the res.partner create function to create new contacts in Odoo. It works fine for all data except for 'lang'.


I'm passing 'lang' as a text field with values like: 'es_ES', 'fr_FR' or 'en_GB'.


Contact is saved and created in Odoo database, but lang field does not seem to be saved (it's always set to the default value: es_ES). Is there a particular way to pass this 'lang' data?


I've also tried passing the lang id from res_lang table, but that just throws an exception with the call.

頭像
捨棄
最佳答案

Hi Paul,


This should work just fine (we do this on our databases too) and it's correct to push the key and not an ID. The field is in fact a selection, not a Many2one.

An important note though: these languages have to be activated (installed) on the database. Otherwise the key for the language doesn't exist on the field "lang". Are you sure these languages are activated in your database and that you have no custom code that overrides the behaviour by setting defaults?

Regards,
Yenthe

頭像
捨棄