Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
5705 Vistas

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?

Avatar
Descartar
Mejor respuesta

Hi, look here

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
0
nov 15
3540
2
jun 23
2931
0
may 21
1743
0
mar 23
1221
1
oct 22
3040