Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
1519 Vues
Hello, I would like to know how I could execute an automatic action from a button in my odoo form


Avatar
Ignorer
Meilleure réponse

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
Ignorer
Publications associées Réponses Vues Activité
1
mars 21
4615
3
mars 15
9667
0
août 23
1717
2
févr. 23
3155
1
déc. 22
5000