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

Hello,


Can someone tell me how to do this?


Thank you so much for your help!

아바타
취소
작성자

Thank you Ray!

In case I have to give a parameter, do I put it between the parenthesis of ".run()"?

베스트 답변
server_action = env['ir.actions.server'].search([('name','=','Second Server Action')])
if server_action:
server_action.run()
아바타
취소
베스트 답변

Thanks for solution Ray, massive help.
To add further use case to this solution, we can specify context to run on specific records (using for loop for example) like this: (I prefer to use action id instead of name, since name can be changed easily)

server_action = env['ir.actions.server'].search([('id','=', your_server_action_id)])
if server_action:
​for record in records:
​server_action.with_context(active_id = record.id, active_model = 'your_model_name').run()




아바타
취소
관련 게시물 답글 화면 활동
0
3월 23
1890
0
7월 21
4512
1
1월 21
5225
1
1월 19
5103
1
1월 18
4697