ex. if i create project then sequence is 001.now i want to create task sequence as per selected project.
project1-001
task1-001, task2-002
project2-002
task1-001, task2-002
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
ex. if i create project then sequence is 001.now i want to create task sequence as per selected project.
project1-001
task1-001, task2-002
project2-002
task1-001, task2-002
You can achieve this thing using overriding the create method in odoo.
def create(self, cr, uid, vals, context={}):
if vals.get('project_id'):
project_obj = self.pool.get('project.project').browse(cr, uid, vals.get('project_id'), context=context)
task_sequence = (self.pool.get('ir.sequence').get(
cr, uid, 'project.task.new', context=context) or '/' )+ (str(project_obj.SEQUENCE_FIELD_name) or '')
vals.update({'TASK SEQENCE FIELD': task_sequence})
return super(CLASS NAME, self).create(cr, uid, vals=vals, context=context)
Hope this will help you.
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ýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
1
thg 10 20
|
2834 | ||
|
3
thg 11 17
|
3798 | ||
|
2
thg 4 16
|
5865 | ||
|
0
thg 3 15
|
3484 | ||
|
2
thg 8 23
|
3422 |