تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
5180 أدوات العرض

I created a new module and extended the model for some module settings:

class TransferSettings(models.TransientModel):
    _inherit = 'res.config.settings'
    _name = 'custom.config.settings'

And added custom fields. 

I created a view for it and appended it to an existing menu. 

Now what I want is to only have one record of this settings but when I open the input form I can only insert new records. It doesen't load previous setting for editing. If I manually write id=1 in the url I get the first inserted record that gets updated, but what I want is to always get the first record since this are settings for the module..

How can I accomplish this?

الصورة الرمزية
إهمال
أفضل إجابة

This because you do new _name = 'custom.config.settings' , so the framework will create new model with new tables, you can just remove "_name = 'custom.config.settings" and will work fine

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
يناير 19
4993
3
يونيو 17
11387
3
سبتمبر 23
3234
1
أغسطس 19
3805
9
يونيو 17
17083