i want to generate emp code sequentially with company name, year and number like "CSM19001" . how it is please let me know.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
1
Trả lời
1631
Lượt xem
You need to create ir.sequence for that but you will have to enter the company name manually.
Sequence:
Prefix: CSM%(year)s
Padding: 3
Code: hr.employee
Create sequence with the given prefix and padding and call it from the create / write method as follow.
vals['code'] = self.env['ir.sequence'].next_by_code('hr.employee') or '-'
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng ký