Hello, I would like to know how I could execute an automatic action from a button in my odoo form
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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
|
5596 | |||
|
3
3月 15
|
11192 | |||
|
0
8月 23
|
2600 | |||
|
2
2月 23
|
4352 | |||
|
1
12月 22
|
5999 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.