Hey!
I've got a bit of code that isn't firing - specifically the "if" portion what am i missing?
proposition_stage_id = env['crm.stage'].search([('name', '=', 'Approved')]).id
record\.opportunity_id\.write\(\{'stage_id':\ proposition_stage_id\}\)
record\.opportunity_id\.write\(\{'expected_revenue':\ record\.amount_untaxed\}\)
record\.opportunity_id\.write\(\{'won_status':\ "won"\}\)
if\ record\.sale_order_template_id\ ==\ 5\ or\ record\.sale_order_template_id\ ==\ 4:
\ \ \ record\.opportunity_id\.write\(\{'user_id':\ 8\}\)
\ \ record.opportunity_id.write({'team_id': 5})
Luke
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Buchhaltung
- Lager
- PoS
- Project
- MRP
Diese Frage wurde gekennzeichnet
I don't know what you are doing with this but you need to compare id
if record.sale_order_template_id.id == 5 or record.sale_order_template_id.id == 4
Perfect - that's sorted it thanks Jan.
The purpose is for Customer approved Quotations to be assigned to our workshop team, where they are progressed (we're a bike shop).
The customer is recieving a permission Error on approving (though it seems to work). Is it safe to give write permission to the portal user group on crm.lead?
Luke
Diskutieren Sie gerne? Treten Sie bei, statt nur zu lesen!
Erstellen Sie heute ein Konto, um exklusive Funktionen zu nutzen und mit unserer tollen Community zu interagieren!
Registrieren
Perfect - that's sorted it thanks Jan.
Luke