Skip to Content
मेन्यू
This question has been flagged
2 Replies
653 Views

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
Discard
Author Best Answer

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
Discard
Best Answer

Hi Luke
Can you send the code you put for action 


Regards...


Avatar
Discard
Author

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")