Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
653 Widoki

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?

Awatar
Odrzuć
Autor Najlepsza odpowiedź

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?

Awatar
Odrzuć
Najlepsza odpowiedź

Hi Luke
Can you send the code you put for action 


Regards...


Awatar
Odrzuć
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")