İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
652 Görünümler

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
Vazgeç
Üretici En İyi Yanıt

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
Vazgeç
En İyi Yanıt

Hi Luke
Can you send the code you put for action 


Regards...


Avatar
Vazgeç
Üretici

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