Skip to Content
Menu
This question has been flagged
1 Reply
1598 Views
Hello, I would like to know how I could execute an automatic action from a button in my odoo form


Avatar
Discard
Best Answer

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

Avatar
Discard
Related Posts Replies Views Activity
1
Mar 21
4769
3
Mar 15
9914
0
Aug 23
1850
2
Feb 23
3341
1
Dec 22
5207