跳至内容
菜单
此问题已终结
1 回复
1514 查看
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
4615
3
3月 15
9666
0
8月 23
1716
2
2月 23
3152
1
12月 22
4998