Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
1 Svar
1492 Visninger
Hello, I would like to know how I could execute an automatic action from a button in my odoo form


Avatar
Kassér
Bedste svar

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
Kassér
Related Posts Besvarelser Visninger Aktivitet
1
mar. 21
4592
3
mar. 15
9636
0
aug. 23
1704
2
feb. 23
3132
1
dec. 22
4982