Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
1476 มุมมอง
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
4570
3
มี.ค. 15
9624
0
ส.ค. 23
1691
2
ก.พ. 23
3114
1
ธ.ค. 22
4970