Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
1496 Tampilan
Hello, I would like to know how I could execute an automatic action from a button in my odoo form


Avatar
Buang
Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
1
Mar 21
4595
3
Mar 15
9640
0
Agu 23
1706
2
Feb 23
3136
1
Des 22
4985