Hello,
Can someone tell me how to do this?
Thank you so much for your help!
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
server_action = env['ir.actions.server'].search([('name','=','Second Server Action')])
if server_action:
server_action.run()
Thanks for solution Ray, massive help.
To add further use case to this solution, we can specify context to run on specific records (using for loop for example) like this: (I prefer to use action id instead of name, since name can be changed easily)
server_action = env['ir.actions.server'].search([('id','=', your_server_action_id)])
if server_action:
for record in records:
server_action.with_context(active_id = record.id, active_model = 'your_model_name').run()
Создайте аккаунт сегодня, чтобы получить доступ к эксклюзивным функциям и стать частью нашего замечательного сообщества!
Регистрация| Похожие посты | Ответы | Просмотры | Активность | |
|---|---|---|---|---|
|
0
мар. 23
|
2530 | |||
|
0
июл. 21
|
5472 | |||
|
1
янв. 21
|
6011 | |||
|
1
янв. 19
|
5761 | |||
|
1
янв. 18
|
5466 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.
Thank you Ray!
In case I have to give a parameter, do I put it between the parenthesis of ".run()"?