Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
655 Vistas

Odoo Version: Odoo 16e

I'm trying to write an automated action to fire when a Sales order is transferred to POS, to move it on in the CRM pipeline etc. Screenshot attached:

This stubbornly does not fire, however.

Can anyone point me in the direction of where my logic is wrong?

Avatar
Descartar
Autor Mejor respuesta

Thanks Azar, but since whenever a new sales.order is created pos_order_lines (?) is set to 0, that would never fire either. 

It does seem unusual to me that it is initially set to 0, rather than false is there some type mismatch error in the model?

Avatar
Descartar
Mejor respuesta

Hi Luke
Can you send the code you put for action 


Regards...


Avatar
Descartar
Autor

collected_stage_id = env['crm.stage'].search([('name', '=', 'Collected')]).id
record.opportunity_id.write({'stage_id': collected_stage_id})
record.opportunity_id.write({'expected_revenue': record.amount_untaxed})
record.opportunity_id.message_post(body="Order Collected, processed via POS")
record.message_post(body="Order Collected, processed via POS")