Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
654 Tampilan

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
Buang
Penulis Jawaban Terbai

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
Buang
Jawaban Terbai

Hi Luke
Can you send the code you put for action 


Regards...


Avatar
Buang
Penulis

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