Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
2443 Visualizzazioni

Hi, 

Currently we are using odoo 13. we created python code for auto seq in sales crm . 

Currently i exploring the Odoo 17, and I use the below steps to add the auto seq.  But it didnot work.   and there is not error .. Please advise

1. Customer fields   - 

   x_enquiry_number 


Sequence (added): 


Automated action 


Below code added in the execute code section

Execute code: 

if not vals.get('x_enquiry_number'): 

         vals['x_enquiry_number'] = self.env['ir.sequence'].next_by_code('enquiry.seq') 



Thanks 



Avatar
Abbandona
Risposta migliore

Hello Arul,

Please review and test the provided code; it could be helpful for your purposes.
Write the automated action on creation and remove the condition.
vals['x_enquiry_number'] = env['ir.sequence'].next_by_code('enquiry.seq')

Thanks,
info@creyox.com


Avatar
Abbandona
Autore

Thanks
Trigger On creation is not found in the automated action (odoo 17)

Autore Risposta migliore

Thanks.

Trigger "On Creation" not listed in the automated action/rules.. 

Thanks 

Avatar
Abbandona

You can use On save option instead of On creation.

Post correlati Risposte Visualizzazioni Attività
1
mar 24
2626
0
mar 24
3031
2
apr 25
3757
2
gen 25
3543
1
mar 24
3088