diff --git a/addons/project/project.py b/addons/project/project.py
index 8bd78c1c80f..f58ac88e284 100644
--- a/addons/project/project.py
+++ b/addons/project/project.py
@@ -28,6 +28,21 @@ from tools.translate import _
from osv import fields, osv
from tools.translate import _
+class project_task_type(osv.osv):
+ _name = 'project.task.type'
+ _description = 'Project task type'
+ _columns = {
+ 'name': fields.char('Type', required=True, size=64, translate=True),
+ 'description': fields.text('Description'),
+ 'sequence': fields.integer('Sequence'),
+ }
+ _order = 'sequence'
+
+ _defaults = {
+ 'sequence': lambda *args: 1
+ }
+project_task_type()
+
class project(osv.osv):
_name = "project.project"
_description = "Project"
@@ -119,6 +134,7 @@ class project(osv.osv):
help='The project can be in either if the states \'Template\' and \'Running\'.\n If it is template then we can make projects based on the template projects. If its in \'Running\' state it is a normal project.\
\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'),
+ 'allowed_task_type': fields.many2many('project.task.type', 'project_task_type_rel', 'project_id', 'type_id', 'Allowed Task Types'),
}
_defaults = {
@@ -206,15 +222,6 @@ class project(osv.osv):
return True
project()
-class project_task_type(osv.osv):
- _name = 'project.task.type'
- _description = 'Project task type'
- _columns = {
- 'name': fields.char('Type', required=True, size=64, translate=True),
- 'description': fields.text('Description'),
- }
-project_task_type()
-
class task(osv.osv):
_name = "project.task"
_description = "Tasks"
@@ -431,6 +438,29 @@ class task(osv.osv):
self.write(cr, uid, ids, {'state': 'pending'})
return True
+ def next_type(self, cr, uid, ids, *args):
+ type_obj = self.pool.get('project.task.type')
+ type_ids = type_obj.search(cr,uid,[])
+ for typ in self.browse(cr, uid, ids):
+ typeid = typ.type.id
+ if typeid and type_ids.index(typeid) != len(type_ids)-1 :
+ index = type_ids.index(typeid)
+ else:
+ index = -1
+ self.write(cr, uid, typ.id, {'type': type_ids[index+1]})
+ return True
+
+ def prev_type(self, cr, uid, ids, *args):
+ type_obj = self.pool.get('project.task.type')
+ type_ids = type_obj.search(cr,uid,[])
+ for typ in self.browse(cr, uid, ids):
+ typeid = typ.type.id
+ if typeid and type_ids.index(typeid) != 0 :
+ index = type_ids.index(typeid)
+ else:
+ index = len(type_ids)
+ self.write(cr, uid, typ.id, {'type': type_ids[index - 1]})
+ return True
task()
diff --git a/addons/project/project_demo.xml b/addons/project/project_demo.xml
index e762d3874ba..a6970365c90 100644
--- a/addons/project/project_demo.xml
+++ b/addons/project/project_demo.xml
@@ -9,17 +9,21 @@
-
- Analysis
+
+ 1
+ Specification
-
- New Feature
+
+ 2
+ Development
-
- Quotation
+
+ 3
+ Testing
-
- Bug
+
+ 4
+ Merge
@@ -53,7 +57,7 @@
38.0
38.0
-
+
BoM, After sales returns, interventions. Tracability.
@@ -62,7 +66,7 @@
16.0
16.0
-
+
Data importation + Doc
@@ -70,7 +74,7 @@
16.0
16.0
-
+
Modifications asked by the customer.
@@ -78,7 +82,7 @@
16.0
16.0
-
+
0
@@ -88,7 +92,7 @@
15
8.0
8.0
-
+
Internal testing + Software Install
@@ -98,7 +102,7 @@
17
16.0
16.0
-
+
2
open
diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml
index c7cfee65d20..18989fbf6d0 100644
--- a/addons/project/project_view.xml
+++ b/addons/project/project_view.xml
@@ -84,7 +84,7 @@
-
+
@@ -99,6 +99,8 @@
+
+
@@ -351,7 +353,10 @@
-
+
+
+
+
@@ -375,6 +380,8 @@
+
+
@@ -480,6 +487,7 @@
+
@@ -495,12 +503,13 @@
- All Tasks
+ Tasks
project.task
form
tree,form,calendar,gantt,graph
+
@@ -613,7 +622,8 @@ menu_main
form
@@ -624,6 +634,7 @@ menu_main
tree
+
diff --git a/addons/project/project_wizard.xml b/addons/project/project_wizard.xml
index d86781ab4ab..3e441e3f8f0 100644
--- a/addons/project/project_wizard.xml
+++ b/addons/project/project_wizard.xml
@@ -3,6 +3,5 @@
-
diff --git a/addons/project/wizard/__init__.py b/addons/project/wizard/__init__.py
index 997b02c90f9..4618faf8463 100644
--- a/addons/project/wizard/__init__.py
+++ b/addons/project/wizard/__init__.py
@@ -21,7 +21,6 @@
import close_task
import task_delegate
-import task_attachment
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project/wizard/task_attachment.py b/addons/project/wizard/task_attachment.py
deleted file mode 100644
index 0d3c88e4874..00000000000
--- a/addons/project/wizard/task_attachment.py
+++ /dev/null
@@ -1,49 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-import wizard
-import pooler
-
-'''View the attachments of the parent + children tasks'''
-
-def _show_attachment(self, cr, uid, data, context):
- task_obj = pooler.get_pool(cr.dbname).get('project.task')
- task_browse_id = task_obj.browse(cr, uid, [data['id']], context)[0]
- attachment_list = [child_id.id for child_id in task_browse_id.child_ids]
- attachment_list.extend([task_browse_id.parent_id.id])
- value = {
- 'domain': [('res_model','=',data['model']),('res_id','in',attachment_list)],
- 'name': 'Attachments',
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'res_model': 'ir.attachment',
- 'context': { },
- 'type': 'ir.actions.act_window'
- }
- return value
-class wizard_attachment(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type':'action', 'action':_show_attachment, 'state': 'end'},
- },
- }
-wizard_attachment('project.task.attachment')
diff --git a/addons/project_gtd/project_gtd_demo.xml b/addons/project_gtd/project_gtd_demo.xml
index ac73d5c7e1e..73584a57c0f 100644
--- a/addons/project_gtd/project_gtd_demo.xml
+++ b/addons/project_gtd/project_gtd_demo.xml
@@ -45,7 +45,7 @@
38.0
-
+
Specific adaptation to MRP
@@ -78,7 +78,7 @@
38.0
-
+
Specific adaptation to MRP