How to generate year in sequence number?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- إدارة علاقات العملاء
- e-Commerce
- المحاسبة
- المخزون
- PoS
- Project
- MRP
لقد تم الإبلاغ عن هذا السؤال
Hi Jordan,
Activate Developer Mode
Go to Sequences Menu, find the sale order.
Change the prefix like how you see in the screenshot.
If you want year to be shown with century(2023) use the code %(year)s .
Hope this helps!!...
HI jordan,
You want to generate year in sequence number so you should try below code,
- This is Sequence.xml file.
- And if you want to change sequence number in sale module than you have to override create method of sale module by using super method.
class SaleOrder(models.Model):
_inherit = 'sale.order'
@api.model
def create(self, vals):
vals['name'] = self.env['ir.sequence'].sudo().next_by_code(
'sale.order') or '/'
res = super(SaleOrder, self).create(vals)
return res
You can add above code into your .py file.
I hope this is helpful to you.
Thanks & Regards,
Email: odoo@devintellecs.com
Skype: devintelle
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيل