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

Hello, our product names are very long, so our Internal References with name-of-product is not viable.

I would like to know if Odoo 10 Enterprise has an option to create patterns or to auto-generate those Internal references after saving the product.

We work with template+variants.

If there's an option to create patterns, much better.

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

Hi, 

Check the below code for generating the sequence 

<data noupdate="1">
<record id="sequence_number_id" model="ir.sequence">
<field name="name">Name of Sequence</field>
<field name="code">your.sequence.model</field>
<field name="prefix">0000</field>
<field name="number_next">1</field>
<field name="number_increment">1</field>
<field name="padding">1</field>
</record>
</data>

You can set this sequence as default in the products Reference number.

sequence_code = 'your.sequence.model'
sequence_number = self.env['ir.sequence'].next_by_code(sequence_code)

Thank you

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

Thanks a lot I will try to discuss this with dev

المنشورات ذات الصلة الردود أدوات العرض النشاط
1
أغسطس 25
304
0
يونيو 24
1681
0
مارس 24
1760
2
يناير 24
2130
1
فبراير 25
3279