تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
2453 أدوات العرض

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 



الصورة الرمزية
إهمال
أفضل إجابة

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


الصورة الرمزية
إهمال
الكاتب

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

الكاتب أفضل إجابة

Thanks.

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

Thanks 

الصورة الرمزية
إهمال

You can use On save option instead of On creation.

المنشورات ذات الصلة الردود أدوات العرض النشاط
1
مارس 24
2630
0
مارس 24
3035
2
أبريل 25
3766
2
يناير 25
3555
1
مارس 24
3091