Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
1478 Zobrazení
Hello, I would like to know how I could execute an automatic action from a button in my odoo form


Avatar
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
bře 21
4570
3
bře 15
9624
0
srp 23
1691
2
úno 23
3115
1
pro 22
4970