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

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ม.ค. 19
5049
3
มิ.ย. 17
11457
I can't inherit a wizard (Odoo v16) แก้ไขแล้ว
3
ก.ย. 23
3272
1
ส.ค. 19
3849
9
มิ.ย. 17
17145