Odoo Help


How to create sequence in task using project.

on 7/7/16, 12:58 PM 1,091 views

ex. if i create project then sequence is 001.now i want to create task sequence as per selected project.


     task1-001, task2-002


     task1-001, task2-002


Krupesh Laiya
On 7/9/16, 1:25 AM

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.

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 7/7/16, 12:58 PM
Seen: 1091 times
Last updated: 7/21/16, 1:49 AM