Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
2 Antworten
2304 Ansichten

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
Verwerfen
Beste Antwort

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
Verwerfen
Autor

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

Autor Beste Antwort

Thanks.

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

Thanks 

Avatar
Verwerfen

You can use On save option instead of On creation.

Verknüpfte Beiträge Antworten Ansichten Aktivität
1
März 24
2448
0
März 24
2907
2
Apr. 25
3540
2
Jan. 25
3336
1
März 24
2940