跳至内容
菜单
此问题已终结
1 回复
5734 查看

I'm trying to call a server action from another server action in Odoo 10. According to the documentation you can assign an action variable within the code of the first action in order to call the next action:

https://www.odoo.com/documentation/10.0/reference/actions.html#code

This doesn't seem to be working for me.

My first action is defined on the stock.quant model with the following code:

if record:

    log('main')

    action = { "type": "ir.actions.server", "id": 366, "model_id": record.product_id.id, }

Then, I have another server action defined, which has database id 366. It's defined on the product.product model with the following code:

log('triggered')

When I trigger the first action, I would expect to see a log entry for "main" and an entry for "triggered". However, I only see an entry for "main", indication that the second action never gets triggered.

Am I doing something wrong? What is the appropriate way to trigger one server action from another server action?

形象
丢弃
最佳答案

Hi, look here

形象
丢弃
相关帖文 回复 查看 活动
0
11月 15
3554
2
6月 23
2964
0
5月 21
1751
0
3月 23
1229
1
10月 22
3054