Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
1 Responder
1509 Visualizações
Hello, I would like to know how I could execute an automatic action from a button in my odoo form


Avatar
Cancelar
Melhor resposta

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
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
1
mar. 21
4613
3
mar. 15
9665
0
ago. 23
1716
2
fev. 23
3147
1
dez. 22
4995