Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
1497 Prikazi
Hello, I would like to know how I could execute an automatic action from a button in my odoo form


Avatar
Opusti
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
Opusti
Related Posts Odgovori Prikazi Aktivnost
1
mar. 21
4596
3
mar. 15
9642
0
avg. 23
1709
2
feb. 23
3141
1
dec. 22
4987