콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
1501 화면
Hello, I would like to know how I could execute an automatic action from a button in my odoo form


아바타
취소
베스트 답변

Hi,

Try this code:

def button_run_action(self):

        action_id = self.env.context.get('automatic_action_id')

        if action_id:

            action = self.env['ir.cron'].sudo().search([('id', '=', action_id)

            action.method_direct_trigger()


Hope it helps

아바타
취소
관련 게시물 답글 화면 활동
1
3월 21
4606
3
3월 15
9658
0
8월 23
1713
2
2월 23
3145
1
12월 22
4991