コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
1490 ビュー
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
4588
3
3月 15
9636
0
8月 23
1703
2
2月 23
3128
1
12月 22
4981