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

I have one2many of model A to B.

class A:

    the_bs: fields.one2many("B")

From A form view I click on one of the B items and B form view is shown with a pop up. There I have set a button and I would like to close B form when I click on it.

아바타
취소
베스트 답변

To close the current open window from a button action just:

return {'type': 'ir.actions.act_window_close'}
아바타
취소
작성자

Hi, Axel. That´s how it is supposed to work but it doesn´t. Eso es lo que se supone que se haga, pero no funciona.

Then something is breaking your js code. Actionmanager if i remember ok is the one responsible for this. You need to debug to find what is going on

베스트 답변

Maybe make the button returns the action of the A form view (if A record still in context, else, just return A tree view)

Update:

you can try this then https://www.odoo.com/fr_FR/forum/help-1/question/solved-close-window-on-button-press-4348

아바타
취소
베스트 답변

Just use:

<button data-dismiss="modal" string="Close my modal"/> in your view. 

I waste some time, while dig this, because this dont work if attribute "type"
of the button is set to anything )
아바타
취소
베스트 답변

Hi py, I got the same issue, I try your solution https://www.odoo.com/fr_FR/forum/help-1/question/solved-close-window-on-button-press-4348, but It doesn't work, any idea?

아바타
취소
작성자 베스트 답변

Thanks.

I already tried that. The result is that the action takes effect in the background window. The popup stays open.

아바타
취소
관련 게시물 답글 화면 활동
1
3월 20
13765
1
3월 21
4822
3
3월 15
9960
1
10월 23
4085
2
2월 23
3382