콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다

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
1월 19
5166
3
6월 17
11629
3
9월 23
3561
1
8월 19
3943
9
6월 17
17276