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


Avatar
Zrušiť
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
Zrušiť
Related Posts Replies Zobrazenia Aktivita
1
mar 21
4575
3
mar 15
9630
0
aug 23
1693
2
feb 23
3123
1
dec 22
4973