Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
1470 Vistas
Hello, I would like to know how I could execute an automatic action from a button in my odoo form


Avatar
Descartar
Mejor respuesta

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
Publicaciones relacionadas Respuestas Vistas Actividad
1
mar 21
4567
3
mar 15
9620
0
ago 23
1687
2
feb 23
3110
1
dic 22
4965