Skip to Content
मेन्यू
This question has been flagged
1 Reply
1500 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
मार्च 21
4603
3
मार्च 15
9643
0
अग॰ 23
1711
2
फ़र॰ 23
3141
1
दिस॰ 22
4987