Skip to Content
Menu
This question has been flagged
1 Atsakyti
5229 Rodiniai

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?

Portretas
Atmesti
Best Answer

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

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
1
saus. 19
5043
3
birž. 17
11447
3
rugs. 23
3262
1
rugp. 19
3836
9
birž. 17
17138