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

Is it possible to override save button and redirect to a new view after saving the record? Or is there another solution?

something like this:

    @api.model

    def create(self, vals):

        return{

           'name': ('new view'),

           'view_type': 'kanban',

           'view_mode': 'kanban',

           'res_model': 'model.test',

           'view_id': False,

           'type': 'ir.actions.act_window',

           'target': 'current',

         }

        return super(CourseSeries, self).create(vals)

아바타
취소
베스트 답변

second return will not be reachable here and you will get an error. so you should override write() method instead of create, where create() should return an id and write() should return a boolean value. There is also save() function available, so do according to your logic.

아바타
취소
작성자

Thanks, but I still cannot open a view after create or write method

just read the answer carefully, create() returns a record or recordset and write() returns Bool values. so they cant return any action or nothing

관련 게시물 답글 화면 활동
0
9월 23
92
5
4월 25
15884
3
11월 20
11751
1
6월 19
5819
1
8월 18
4875