跳至內容
選單
此問題已被標幟
1 回覆
1473 瀏覽次數
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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
3月 21
4569
3
3月 15
9622
0
8月 23
1689
2
2月 23
3113
1
12月 22
4968