Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
1508 Переглядів
Hello, I would like to know how I could execute an automatic action from a button in my odoo form


Аватар
Відмінити
Найкраща відповідь

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

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
бер. 21
4613
3
бер. 15
9665
0
серп. 23
1716
2
лют. 23
3147
1
груд. 22
4995