Skip to Content
Menú
This question has been flagged
1 Respondre
1599 Vistes
Hello, I would like to know how I could execute an automatic action from a button in my odoo form


Avatar
Descartar
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
Descartar
Related Posts Respostes Vistes Activitat
1
de març 21
4769
3
de març 15
9917
0
d’ag. 23
1850
2
de febr. 23
3344
1
de des. 22
5207