From ce2a8bcb22ab0d7ecf4931220f8818b7e59f2d23 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Tue, 19 Jan 2010 21:43:15 +0100 Subject: [PATCH] [IMP] project views bzr revid: fp@tinyerp.com-20100119204315-yxqms2s4ut1sgele --- addons/project/project.py | 22 +++++---------------- addons/project/project_demo.xml | 8 ++++---- addons/project/project_view.xml | 35 +++++++++------------------------ 3 files changed, 18 insertions(+), 47 deletions(-) diff --git a/addons/project/project.py b/addons/project/project.py index 599bf620995..815f69ecf3d 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -132,7 +132,7 @@ class project(osv.osv): # \n If it is to be reviewed then the state is \'Pending\'.\n When the project is completed the state is set to \'Done\'.'), # 'company_id': fields.many2one('res.company', 'Company'), # 'timesheet_id': fields.many2one('hr.timesheet.group', 'Working Time', help="Timetable working hours to adjust the gantt diagram report"), - 'allowed_task_type': fields.many2many('project.task.type', 'project_task_type_rel', 'project_id', 'type_id', 'Allowed Task Types'), + 'type_ids': fields.many2many('project.task.type', 'project_task_type_rel', 'project_id', 'type_id', 'Allowed Task Types'), } _defaults = { @@ -489,35 +489,23 @@ class task(osv.osv): return True def next_type(self, cr, uid, ids, *args): - type_obj = self.pool.get('project.task.type') - types = [] for typ in self.browse(cr, uid, ids): typeid = typ.type.id - types = map(lambda x:x.id, typ.project_id.allowed_task_type) + types = map(lambda x:x.id, typ.project_id.type_ids) if types: if typeid and typeid in types and types.index(typeid) != len(types)-1 : index = types.index(typeid) - else: - index = -1 - self.write(cr, uid, typ.id, {'type': types[index+1]}) - else: - self.write(cr, uid, typ.id, {'type': ''}) + self.write(cr, uid, typ.id, {'type': types[index+1]}) return True def prev_type(self, cr, uid, ids, *args): - type_obj = self.pool.get('project.task.type') - types = [] for typ in self.browse(cr, uid, ids): typeid = typ.type.id - types = map(lambda x:x.id, typ.project_id.allowed_task_type) + types = map(lambda x:x.id, typ.project_id.type_ids) if types: if typeid and typeid in types and types.index(typeid) != 0 : index = types.index(typeid) - else: - index = len(types) - self.write(cr, uid, typ.id, {'type': types[index-1]}) - else: - self.write(cr, uid, typ.id, {'type': ''}) + self.write(cr, uid, typ.id, {'type': types[index-1]}) return True task() diff --git a/addons/project/project_demo.xml b/addons/project/project_demo.xml index 38f8440e027..7b5d565fead 100644 --- a/addons/project/project_demo.xml +++ b/addons/project/project_demo.xml @@ -32,7 +32,7 @@ 1 Open ERP Integration - + 1 @@ -41,7 +41,7 @@ Study + Prototype - + 20 @@ -49,7 +49,7 @@ Specific Developements - + 30 @@ -57,7 +57,7 @@ Install, data import, configuration - + diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index c93b59b9b50..cee6d9ac2e2 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -83,24 +83,9 @@