summaryrefslogtreecommitdiff
path: root/addons/project
diff options
context:
space:
mode:
authorNaresh Choksy <nch@tinyerp.com>2008-11-04 11:16:45 +0530
committerNaresh Choksy <nch@tinyerp.com>2008-11-04 11:16:45 +0530
commit2a4096b752f3634fe255ecd78e842e11d1801a67 (patch)
tree9ed47e680afe293497461adf430f146c60e97da2 /addons/project
parent54651e2f34af1412df5ab5d3e371bdc4d0600b23 (diff)
parentda8aa7411aef2f2b962b2b67b73563dce4c45bee (diff)
merges
bzr revid: nch@tinyerp.com-20081104054645-pqtvoho3hiyjb2yf
Diffstat (limited to 'addons/project')
-rw-r--r--addons/project/__init__.py35
-rw-r--r--addons/project/__terp__.py35
-rw-r--r--addons/project/company.py34
-rw-r--r--addons/project/process/task_process.xml4
-rw-r--r--addons/project/project.py103
-rw-r--r--addons/project/project_demo.xml24
-rw-r--r--addons/project/project_view.xml146
-rw-r--r--addons/project/report/__init__.py35
-rw-r--r--addons/project/report/_date_compute.py34
-rw-r--r--addons/project/report/gantt.py35
-rw-r--r--addons/project/report/gantt_report.py34
-rw-r--r--addons/project/wizard/__init__.py34
-rw-r--r--addons/project/wizard/close_task.py35
-rw-r--r--addons/project/wizard/task_delegate.py63
14 files changed, 310 insertions, 341 deletions
diff --git a/addons/project/__init__.py b/addons/project/__init__.py
index 4290a3ffef6..295f1d4bbe8 100644
--- a/addons/project/__init__.py
+++ b/addons/project/__init__.py
@@ -1,31 +1,24 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
-# Copyright (c) 2004-2008 Tiny SPRL (http://tiny.be) All Rights Reserved.
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
+# $Id$
#
-# $Id$
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
+# 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 General Public License for more details.
#
-# This program is Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-# 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 General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-###############################################################################
+##############################################################################
import project
import company
diff --git a/addons/project/__terp__.py b/addons/project/__terp__.py
index d153de14336..a698d4e0827 100644
--- a/addons/project/__terp__.py
+++ b/addons/project/__terp__.py
@@ -1,31 +1,24 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
-# Copyright (c) 2004-2008 Tiny SPRL (http://tiny.be) All Rights Reserved.
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
+# $Id$
#
-# $Id$
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
+# 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 General Public License for more details.
#
-# This program is Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-# 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 General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-###############################################################################
+##############################################################################
{
"name" : "Project Management",
"version": "1.0",
diff --git a/addons/project/company.py b/addons/project/company.py
index 990586c48ee..912d9f3b12a 100644
--- a/addons/project/company.py
+++ b/addons/project/company.py
@@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
-# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
+# $Id$
#
-# $Id$
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
+# 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 General Public License for more details.
#
-# This program is Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# 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 General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
diff --git a/addons/project/process/task_process.xml b/addons/project/process/task_process.xml
index 9ba6a39b9dc..f987ba07af3 100644
--- a/addons/project/process/task_process.xml
+++ b/addons/project/process/task_process.xml
@@ -39,7 +39,7 @@
</record>
<record id="process_node_opentask0" model="process.node">
- <field name="menu_id" ref="project.menu_action_view_task6"/>
+ <field name="menu_id" ref="menu_tasks_yours_prog"/>
<field name="model_id" ref="project.model_project_task"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Open task&quot;&quot;&quot;" name="name"/>
@@ -152,4 +152,4 @@
</record>
</data>
-</openerp> \ No newline at end of file
+</openerp>
diff --git a/addons/project/project.py b/addons/project/project.py
index f27fa4f00c9..d99109007bf 100644
--- a/addons/project/project.py
+++ b/addons/project/project.py
@@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
-# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
+# $Id$
#
-# $Id$
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
+# 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 General Public License for more details.
#
-# This program is Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# 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 General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@@ -109,6 +101,11 @@ class project(osv.osv):
res[id] = prog / tot
return res
+ def unlink(self, cr, uid, ids, *args, **kwargs):
+ for proj in self.browse(cr, uid, ids):
+ if proj.tasks:
+ raise osv.except_osv(_('Operation Not Permited !'), _('You can not delete a project with tasks. I suggest you to desactivate it.'))
+ return super(project, self).unlink(cr, uid, ids, *args, **kwargs)
_columns = {
'name': fields.char("Project Name", size=128, required=True),
'active': fields.boolean('Active'),
@@ -116,23 +113,23 @@ class project(osv.osv):
'priority': fields.integer('Sequence'),
'manager': fields.many2one('res.users', 'Project Manager'),
'warn_manager': fields.boolean('Warn Manager', help="If you check this field, the project manager will receive a request each time a task is completed by his team."),
- 'members': fields.many2many('res.users', 'project_user_rel', 'project_id', 'uid', 'Project Members'),
+ 'members': fields.many2many('res.users', 'project_user_rel', 'project_id', 'uid', 'Project Members', help="Project's member. Not used in any computation, just for information purpose."),
'tasks': fields.one2many('project.task', 'project_id', "Project tasks"),
'parent_id': fields.many2one('project.project', 'Parent Project'),
'child_id': fields.one2many('project.project', 'parent_id', 'Subproject'),
- 'planned_hours': fields.function(_calc_planned, method=True, string='Planned hours'),
- 'effective_hours': fields.function(_calc_effective, method=True, string='Hours spent'),
+ 'planned_hours': fields.function(_calc_planned, method=True, string='Planned hours', help="Sum of planned hours of all tasks related to this project."),
+ 'effective_hours': fields.function(_calc_effective, method=True, string='Hours spent', help="Sum of spent hours of all tasks related to this project."),
'progress_rate': fields.function(_progress_rate, method=True, string='Progress', type='float', help="Percent of tasks closed according to the total of tasks todo."),
'date_start': fields.date('Starting Date'),
'date_end': fields.date('Expected End'),
'partner_id': fields.many2one('res.partner', 'Partner'),
'contact_id': fields.many2one('res.partner.address', 'Contact'),
- 'warn_customer': fields.boolean('Warn Partner'),
- 'warn_header': fields.text('Mail header'),
- 'warn_footer': fields.text('Mail footer'),
- 'notes': fields.text('Notes'),
- 'timesheet_id': fields.many2one('hr.timesheet.group', 'Working Time'),
- 'state': fields.selection([('template', 'Template'), ('open', 'Open'), ('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done')], 'State', required=True),
+ 'warn_customer': fields.boolean('Warn Partner', help="If you check this, the user will have a popup when closing a task that propose a message to send by email to the customer."),
+ 'warn_header': fields.text('Mail Header', help="Header added at the beginning of the email for the warning message sent to the customer when a task is closed."),
+ 'warn_footer': fields.text('Mail Footer', help="Footer added at the beginning of the email for the warning message sent to the customer when a task is closed."),
+ 'notes': fields.text('Notes', help="Internal description of the project."),
+ 'timesheet_id': fields.many2one('hr.timesheet.group', 'Working Time', help="Timetable working hours to adjust the gantt diagram report"),
+ 'state': fields.selection([('template', 'Template'), ('open', 'Running'), ('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done')], 'State', required=True, readonly=True),
}
_defaults = {
@@ -153,6 +150,22 @@ class project(osv.osv):
res = self.setActive(cr, uid, ids, value=False, context=context)
return res
+ def set_done(self, cr, uid, ids, context={}):
+ self.write(cr, uid, ids, {'state':'done'}, context=context)
+ return True
+
+ def set_cancel(self, cr, uid, ids, context={}):
+ self.write(cr, uid, ids, {'state':'cancelled'}, context=context)
+ return True
+
+ def set_pending(self, cr, uid, ids, context={}):
+ self.write(cr, uid, ids, {'state':'pending'}, context=context)
+ return True
+
+ def set_open(self, cr, uid, ids, context={}):
+ self.write(cr, uid, ids, {'state':'open'}, context=context)
+ return True
+
def reset_project(self, cr, uid, ids, context={}):
res = self.setActive(cr, uid, ids,value=True, context=context)
return res
@@ -176,7 +189,11 @@ class project(osv.osv):
project_ids = [x[0] for x in res]
for child in project_ids:
self.duplicate_template(cr, uid, [child],context={'parent_id':new_id})
- return True
+
+ # TODO : Improve this to open the new project (using a wizard)
+
+ cr.commit()
+ raise osv.except_osv(_('Operation Done'), _('A new project has been created !\nWe suggest you to close this one and work on this new project.'))
# set active value for a project, its sub projects and its tasks
def setActive(self, cr, uid, ids, value=True, context={}):
@@ -248,6 +265,11 @@ class task(osv.osv):
def onchange_planned(self, cr, uid, ids, planned, effective):
return {'value':{'remaining_hours': planned-effective}}
+ def _default_project(self, cr, uid, context={}):
+ if 'project_id' in context and context['project_id']:
+ return context['project_id']
+ return False
+
#_sql_constraints = [
# ('remaining_hours', 'CHECK (remaining_hours>=0)', 'Please increase and review remaining hours ! It can not be smaller than 0.'),
#]
@@ -259,8 +281,8 @@ class task(osv.osv):
'priority' : fields.selection([('4','Very Low'), ('3','Low'), ('2','Medium'), ('1','Urgent'), ('0','Very urgent')], 'Importance'),
'sequence': fields.integer('Sequence'),
'type': fields.many2one('project.task.type', 'Type'),
- 'state': fields.selection([('draft', 'Draft'),('open', 'Open'),('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done')], 'Status', readonly=True, required=True),
- 'date_start': fields.datetime('Date Opened'),
+ 'state': fields.selection([('draft', 'Draft'),('open', 'In Progress'),('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done')], 'Status', readonly=True, required=True),
+ 'date_start': fields.datetime('Starting Date'),
'date_deadline': fields.datetime('Deadline'),
'date_close': fields.datetime('Date Closed', readonly=True),
'project_id': fields.many2one('project.project', 'Project', ondelete='cascade'),
@@ -269,12 +291,12 @@ class task(osv.osv):
'history': fields.function(_history_get, method=True, string="Task Details", type="text"),
'notes': fields.text('Notes'),
- 'planned_hours': fields.float('Planned Hours', readonly=True, states={'draft':[('readonly',False)]}, required=True),
- 'effective_hours': fields.function(_hours_get, method=True, string='Hours Spent', multi='hours', store=True),
- 'remaining_hours': fields.float('Remaining Hours', digits=(16,2)),
- 'total_hours': fields.function(_hours_get, method=True, string='Total Hours', multi='hours', store=True),
- 'progress': fields.function(_hours_get, method=True, string='Progress (%)', multi='hours', store=True),
- 'delay_hours': fields.function(_hours_get, method=True, string='Delay Hours', multi='hours', store=True),
+ 'planned_hours': fields.float('Planned Hours', readonly=True, states={'draft':[('readonly',False)]}, required=True, help='Estimated time to do the task, usually set by the project manager when the task is in draft state.'),
+ 'effective_hours': fields.function(_hours_get, method=True, string='Hours Spent', multi='hours', store=True, help="Computed using the sum of the task work done."),
+ 'remaining_hours': fields.float('Remaining Hours', digits=(16,2), help="Total remaining time, can be re-estimated periodically by the assignee of the task."),
+ 'total_hours': fields.function(_hours_get, method=True, string='Total Hours', multi='hours', store=True, help="Computed as: Time Spent + Remaining Time."),
+ 'progress': fields.function(_hours_get, method=True, string='Progress (%)', multi='hours', store=True, help="Computed as: Time Spent / Total Time."),
+ 'delay_hours': fields.function(_hours_get, method=True, string='Delay Hours', multi='hours', store=True, help="Computed as: Total Time - Estimated Time. It gives the difference of the time estimated by the project manager and the real time to close the task."),
'user_id': fields.many2one('res.users', 'Assigned to'),
'partner_id': fields.many2one('res.partner', 'Partner'),
@@ -288,6 +310,7 @@ class task(osv.osv):
'sequence': lambda *a: 10,
'active': lambda *a: True,
'date_start': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
+ 'project_id': _default_project,
}
_order = "sequence, priority, date_deadline, id"
@@ -344,7 +367,7 @@ class task(osv.osv):
project = task.project_id
if project and project.warn_manager and project.manager.id and (project.manager.id != uid):
request.create(cr, uid, {
- 'name': "Task '%s' reopened" % task.name,
+ 'name': "Task '%s' set in progress" % task.name,
'state': 'waiting',
'act_from': uid,
'act_to': project.manager.id,
diff --git a/addons/project/project_demo.xml b/addons/project/project_demo.xml
index e95faefc384..9a25d722689 100644
--- a/addons/project/project_demo.xml
+++ b/addons/project/project_demo.xml
@@ -6,6 +6,19 @@
Resource: project.project
-->
+ <record id="project_tt_analysis" model="project.task.type">
+ <field name="name">Analysis</field>
+ </record>
+ <record id="project_tt_feature" model="project.task.type">
+ <field name="name">New Feature</field>
+ </record>
+ <record id="project_tt_quote" model="project.task.type">
+ <field name="name">Quotation</field>
+ </record>
+ <record id="project_tt_bug" model="project.task.type">
+ <field name="name">Bug</field>
+ </record>
+
<record id="project_project_9" model="project.project">
<field name="warn_manager">1</field>
<field name="name">Tiny ERP Integration</field>
@@ -37,6 +50,7 @@
<record id="project_task_116" model="project.task">
<field name="planned_hours">38.0</field>
<field name="remaining_hours">38.0</field>
+ <field name="type" ref="project_tt_feature"/>
<field name="user_id" ref="base.user_root"/>
<field name="project_id" ref="project_project_22"/>
<field name="description">BoM, After sales returns, interventions. Tracability.</field>
@@ -45,6 +59,7 @@
<record id="project_task_130" model="project.task">
<field name="planned_hours">16.0</field>
<field name="remaining_hours">16.0</field>
+ <field name="type" ref="project_tt_feature"/>
<field model="res.users" name="user_id" search="[('login','=','demo')]"/>
<field name="project_id" ref="project_project_23"/>
<field name="name">Data importation + Doc</field>
@@ -52,6 +67,7 @@
<record id="project_task_131" model="project.task">
<field name="planned_hours">16.0</field>
<field name="remaining_hours">16.0</field>
+ <field name="type" ref="project_tt_feature"/>
<field model="res.users" name="user_id" search="[('login','=','demo')]"/>
<field name="project_id" ref="project_project_23"/>
<field name="name">Modifications asked by the customer.</field>
@@ -59,6 +75,7 @@
<record id="project_task_184" model="project.task">
<field name="planned_hours">16.0</field>
<field name="remaining_hours">16.0</field>
+ <field name="type" ref="project_tt_feature"/>
<field model="res.users" name="user_id" search="[('login','=','demo')]"/>
<field name="priority">0</field>
<field name="project_id" ref="project_project_21"/>
@@ -68,6 +85,7 @@
<field name="sequence">15</field>
<field name="planned_hours">8.0</field>
<field name="remaining_hours">8.0</field>
+ <field name="type" ref="project_tt_feature"/>
<field model="res.users" name="user_id" search="[('login','=','demo')]"/>
<field name="project_id" ref="project_project_21"/>
<field name="name">Internal testing + Software Install</field>
@@ -77,8 +95,10 @@
<field name="sequence">17</field>
<field name="planned_hours">16.0</field>
<field name="remaining_hours">16.0</field>
+ <field name="type" ref="project_tt_feature"/>
<field model="res.users" name="user_id" search="[('login','=','demo')]"/>
<field name="priority">2</field>
+ <field name="state">open</field>
<field name="project_id" ref="project_project_21"/>
<field name="name">Analysis, Data Importation</field>
</record>
@@ -86,6 +106,7 @@
<field name="sequence">20</field>
<field name="planned_hours">16.0</field>
<field name="remaining_hours">16.0</field>
+ <field name="state">open</field>
<field model="res.users" name="user_id" search="[('login','=','demo')]"/>
<field name="project_id" ref="project_project_23"/>
<field name="name">Parameters</field>
@@ -95,6 +116,7 @@
<field name="planned_hours">32.0</field>
<field name="remaining_hours">32.0</field>
<field model="res.users" name="user_id" search="[('login','=','demo')]"/>
+ <field name="state">open</field>
<field name="project_id" ref="project_project_21"/>
<field name="name">Start of the doc redaction + MRP</field>
</record>
@@ -104,6 +126,7 @@
<field name="remaining_hours">24.0</field>
<field model="res.users" name="user_id" search="[('login','=','demo')]"/>
<field name="project_id" ref="project_project_21"/>
+ <field name="state">done</field>
<field name="name">MRP Tests</field>
</record>
<record id="project_task_193" model="project.task">
@@ -178,6 +201,7 @@
<field name="remaining_hours">32.0</field>
<field name="user_id" ref="base.user_root"/>
<field name="project_id" ref="project_project_23"/>
+ <field name="state">open</field>
<field name="name">In house trainings</field>
<field name="date_deadline">2007-06-06</field>
</record>
diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml
index 12f9a17491f..c30aa71069b 100644
--- a/addons/project/project_view.xml
+++ b/addons/project/project_view.xml
@@ -2,6 +2,7 @@
<openerp>
<data>
<menuitem icon="terp-project" id="menu_main" name="Project Management"/>
+ <menuitem id="menu_tasks" name="Tasks" parent="menu_main"/>
<menuitem id="menu_definitions" name="Configuration" parent="project.menu_main" sequence="1"/>
<!-- Project -->
@@ -27,20 +28,27 @@
<field name="active" select="2"/>
<field name="planned_hours" widget="float_time"/>
<field name="effective_hours" widget="float_time"/>
+ <field name="category_id" select="2"/>
<newline/>
<separator colspan="4" string="Project's members"/>
<field colspan="4" name="members" nolabel="1"/>
- <group col="6" colspan="8">
+ <group col="9" colspan="8">
<field name="state"/>
<button name="set_template" string="Set as Template" type="object" states="open"/>
+ <button name="set_open" string="Reactivate Project" type="object" states="pending,cancelled,done"/>
+ <button name="set_pending" string="Pending" type="object" states="open"/>
+ <button name="set_cancel" string="Cancel" type="object" states="open,pending"/>
+ <button name="set_done" string="Done" type="object" states="open,pending"/>
<button name="reset_project" string="Reset as Project" type="object" states="template"/>
- <button name="duplicate_template" string="Duplicate Template" type="object" states="template"/>
+ <button name="duplicate_template"
+ string="New Project Based on Template"
+ type="object"
+ states="template"/>
</group>
</page>
<page groups="base.group_extended" string="Partner Info">
<field colspan="4" name="partner_id" on_change="onchange_partner_id(partner_id)" select="1"/>
<field domain="[('partner_id','=',partner_id)]" name="contact_id" select="2"/>
- <field name="category_id" select="2"/>
<field name="warn_customer"/>
<newline/>
<separator colspan="2" string="Mail Header"/>
@@ -48,6 +56,7 @@
<field name="warn_header" nolabel="1" colspan="2"/>
<field name="warn_footer" nolabel="1" colspan="2"/>
<group col="3" colspan="4">
+ <separator string="Automatic variables for headers and footer. Use exactly the same notation." colspan="4"/>
<label string="Task: %%(name)s"/>
<label string="User: %%(user_id)s"/>
<label string="ID: %%(task_id)s"/>
@@ -81,36 +90,10 @@
</tree>
</field>
</record>
- <record id="open_view_all_project" model="ir.actions.act_window">
- <field name="name">All Projects</field>
- <field name="res_model">project.project</field>
- <field name="view_type">tree</field>
- <field name="domain">[('parent_id','=',False)]</field>
- <field name="view_id" ref="view_project"/>
- </record>
- <menuitem action="open_view_all_project" id="menu_all_project" parent="project.menu_main"/>
-
- <record id="open_view_all_project_unclosed" model="ir.actions.act_window">
- <field name="name">Unclosed projects</field>
- <field name="res_model">project.project</field>
- <field name="view_type">tree</field>
- <field name="domain">[('parent_id','=',False),('state','&lt;&gt;','cancelled'),('state','&lt;&gt;','done')]</field>
- <field name="view_id" ref="view_project"/>
- </record>
- <menuitem action="open_view_all_project_unclosed" id="menu_all_project_unclosed" parent="project.menu_all_project"/>
-
-
- <record id="open_view_all_project_unclosed_open" model="ir.actions.act_window">
- <field name="name">Open projects</field>
- <field name="res_model">project.project</field>
- <field name="view_type">tree</field>
- <field name="domain">[('parent_id','=',False),('state','=','open')]</field>
- <field name="view_id" ref="view_project"/>
- </record>
- <menuitem action="open_view_all_project_unclosed_open" id="menu_all_project_unclosed_open" parent="project.menu_all_project_unclosed"/>
+ <menuitem id="menu_all_project" parent="project.menu_main" name="Projects"/>
<record id="open_view_project_open" model="ir.actions.act_window">
- <field name="name">Open projects</field>
+ <field name="name">Running projects</field>
<field name="res_model">project.project</field>
<field name="view_type">form</field>
<field name="domain">[('state','=','open')]</field>
@@ -119,14 +102,13 @@
<menuitem action="open_view_project_open" id="menu_open_view_project_open" parent="menu_all_project"/>
<record id="open_view_template_project" model="ir.actions.act_window">
- <field name="name">Template projects</field>
+ <field name="name">Template of Projects</field>
<field name="res_model">project.project</field>
<field name="view_type">form</field>
<field name="domain">[('state','=','template')]</field>
<field name="view_id" ref="view_project"/>
</record>
- <menuitem id="next_id_54" name="Projects" parent="project.menu_definitions"/>
- <menuitem action="open_view_template_project" id="menu_template_project" parent="next_id_54"/>
+ <menuitem action="open_view_template_project" id="menu_template_project" parent="project.menu_definitions"/>
<record id="open_view_project" model="ir.actions.act_window">
<field name="name">New Project</field>
@@ -135,7 +117,7 @@
<field name="view_mode">form,tree,calendar</field>
<field name="view_id" eval="False"/>
</record>
- <menuitem action="open_view_project" id="menu_open_view_project" parent="menu_all_project"/>
+ <menuitem action="open_view_project" id="menu_open_view_project" parent="menu_all_project" sequence="50"/>
<record id="view_task_work_form" model="ir.ui.view">
<field name="name">project.task.work.form</field>
@@ -182,33 +164,37 @@
</field>
</record>
<record id="open_view_my_project" model="ir.actions.act_window">
- <field name="name">My projects</field>
+ <field name="name">My Projects</field>
<field name="res_model">project.project</field>
- <field name="view_type">tree</field>
- <field name="domain">[('parent_id','=',False),('manager', '=', uid)]</field>
+ <field name="view_type">form</field>
+ <field name="domain">[('manager', '=', uid)]</field>
<field name="view_id" ref="view_my_project"/>
</record>
- <menuitem action="open_view_my_project" id="menu_open_view_my_project" parent="project.menu_main"/>
+ <menuitem action="open_view_my_project" id="menu_open_view_my_project" parent="menu_all_project"
+ sequence="1"/>
-
- <record id="open_view_my_project_open_unclosed" model="ir.actions.act_window">
- <field name="name">My unclosed projects</field>
+ <record id="open_view_my_project_my_run" model="ir.actions.act_window">
+ <field name="name">My Running Projects</field>
<field name="res_model">project.project</field>
- <field name="view_type">tree</field>
- <field name="domain">[('parent_id','=',False),('manager', '=', uid),('state','&lt;&gt;','cancelled'),('state','&lt;&gt;','done')]</field>
+ <field name="view_type">form</field>
+ <field name="domain">[('manager', '=', uid),('state','=','open')]</field>
<field name="view_id" ref="view_my_project"/>
</record>
- <menuitem action="open_view_my_project_open_unclosed" id="menu_open_view_my_project_open_unclosed" parent="project.menu_open_view_my_project"/>
-
+ <menuitem
+ action="open_view_my_project_my_run"
+ id="menu_open_view_my_project_my_run"
+ parent="menu_open_view_my_project"/>
<record id="open_view_my_project_open" model="ir.actions.act_window">
- <field name="name">My open projects</field>
+ <field name="name">Projects Structure</field>
<field name="res_model">project.project</field>
<field name="view_type">tree</field>
- <field name="domain">[('parent_id','=',False),('manager', '=', uid),('state','=','open')]</field>
- <field name="view_id" ref="view_my_project"/>
+ <field name="domain">[('parent_id','=',False)]</field>
</record>
- <menuitem action="open_view_my_project_open" id="menu_open_view_my_project_open" parent="project.menu_open_view_my_project_open_unclosed"/>
+ <menuitem
+ action="open_view_my_project_open"
+ id="menu_open_view_my_project_open"
+ parent="project.menu_all_project"/>
<!-- Task -->
<record id="view_task_form2" model="ir.ui.view">
@@ -241,10 +227,10 @@
<newline/>
<group col="11" colspan="4">
<field name="state" select="1"/>
- <button name="do_draft" states="open" string="Set Draft" type="object"/>
- <button name="do_open" states="pending,draft" string="Open" type="object"/>
- <button name="do_reopen" states="done,cancelled" string="Re-open" type="object"/>
- <button name="do_pending" states="open" string="Set Pending" type="object"/>
+ <button name="do_draft" states="open" string="Draft" type="object"/>
+ <button name="do_open" states="pending,draft" string="Start Task" type="object"/>
+ <button name="do_reopen" states="done,cancelled" string="Reactivate" type="object"/>
+ <button name="do_pending" states="open" string="Pending" type="object"/>
<button groups="base.group_extended" name="%(wizard_delegate_task)d" states="pending,open" string="Delegate" type="action"/>
<button name="%(wizard_close_task)d" states="pending,open" string="Done" type="action"/>
<button name="do_cancel" states="draft,open,pending" string="Cancel" type="object"/>
@@ -352,7 +338,7 @@
<field name="view_mode">tree,form,calendar,gantt,graph</field>
<field eval="False" name="view_id"/>
</record>
- <menuitem action="action_view_task" id="menu_action_view_task" parent="project.menu_main"/>
+ <menuitem action="action_view_task" id="menu_action_view_task" parent="project.menu_tasks"/>
<record id="action_view_task4" model="ir.actions.act_window">
<field name="name">My Tasks</field>
@@ -361,7 +347,7 @@
<field name="view_mode">tree,form,calendar,gantt,graph</field>
<field name="domain">[('user_id', '=', uid)]</field>
</record>
- <menuitem action="action_view_task4" id="menu_action_view_task4" parent="project.menu_main"/>
+ <menuitem action="action_view_task4" id="menu_action_view_task4" parent="project.menu_tasks"/>
<record id="action_view_task5_pending" model="ir.actions.act_window">
<field name="name">My Pending Tasks</field>
@@ -372,40 +358,42 @@
</record>
<menuitem action="action_view_task5_pending" id="menu_tasks_yours_pending" parent="menu_action_view_task4"/>
- <record id="action_view_task5" model="ir.actions.act_window">
- <field name="name">My Open Tasks</field>
+ <record id="action_view_task5_prog" model="ir.actions.act_window">
+ <field name="name">My Current Tasks</field>
<field name="res_model">project.task</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,calendar,graph</field>
- <field name="domain">[('user_id', '=', uid),('state','=','open')]</field>
+ <field name="domain">[('user_id', '=', uid),('state','in',('open','draft'))]</field>
</record>
- <menuitem action="action_view_task5" id="menu_tasks_yours" parent="menu_action_view_task4"/>
+ <menuitem action="action_view_task5_prog" id="menu_tasks_yours_prog" parent="menu_action_view_task4"
+ sequence="1"/>
- <record id="action_view_task5_prog" model="ir.actions.act_window">
+ <record id="action_view_task5_prog_prog" model="ir.actions.act_window">
<field name="name">My Tasks in Progress</field>
<field name="res_model">project.task</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,calendar,graph</field>
- <field name="domain">[('user_id', '=', uid),('state','=','open')]</field>
+ <field name="domain">[('user_id', '=', uid),('state','=','open'))]</field>
</record>
- <menuitem action="action_view_task5_prog" id="menu_tasks_yours_prog" parent="menu_action_view_task4"/>
+ <menuitem action="action_view_task5_prog_prog" id="menu_tasks_yours_prog_prog" parent="menu_tasks_yours_prog"/>
- <record id="action_view_task_new" model="ir.actions.act_window">
- <field name="name">New Task</field>
+ <record id="action_view_task5_prog_draft" model="ir.actions.act_window">
+ <field name="name">My Draft Tasks</field>
<field name="res_model">project.task</field>
<field name="view_type">form</field>
- <field name="view_mode">form,tree,calendar,graph</field>
+ <field name="view_mode">tree,form,calendar,graph</field>
+ <field name="domain">[('user_id', '=', uid),('state','=','draft'))]</field>
</record>
- <menuitem action="action_view_task_new" id="menu_action_view_task_new" parent="menu_action_view_task4"/>
+ <menuitem action="action_view_task5_prog_draft" id="menu_tasks_yours_prog_draft" parent="menu_tasks_yours_prog"/>
+
- <record id="action_view_task6" model="ir.actions.act_window">
- <field name="name">Open Tasks</field>
+ <record id="action_view_task_new" model="ir.actions.act_window">
+ <field name="name">New Task</field>
<field name="res_model">project.task</field>
<field name="view_type">form</field>
- <field name="view_mode">tree,form,calendar,graph</field>
- <field name="domain">[('state', '=', 'open')]</field>
+ <field name="view_mode">form,tree,calendar,graph</field>
</record>
- <menuitem action="action_view_task6" id="menu_action_view_task6" parent="project.menu_action_view_task"/>
+ <menuitem action="action_view_task_new" id="menu_action_view_task_new" parent="menu_tasks"/>
<record id="action_view_task6_prog" model="ir.actions.act_window">
<field name="name">Tasks in Progress</field>
@@ -432,6 +420,7 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form,calendar,graph</field>
<field name="domain">[('project_id', 'child_of', [active_id])]</field>
+ <field name="context">{'project_id':active_id}</field>
</record>
<record id="ir_project_task_open" model="ir.values">
<field eval=" 'tree_but_open'" name="key2"/>
@@ -475,6 +464,15 @@
<act_window
domain="[('project_id', '=', active_id)]"
+ id="act_project_project_2_project_task_new"
+ name="Create a Task"
+ res_model="project.task"
+ src_model="project.project"
+ view_mode="form,tree,calendar,graph"
+ view_type="form"/>
+
+ <act_window
+ domain="[('project_id', '=', active_id)]"
id="act_project_project_2_project_task_all"
name="All Tasks"
res_model="project.task"
@@ -485,14 +483,12 @@
<act_window
domain="[('project_id', '=', active_id),('state', '&lt;&gt;', 'cancelled'),('state', '&lt;&gt;', 'done')]"
id="act_project_project_2_project_task_opened"
- name="Open Tasks"
+ name="Tasks in Progress"
res_model="project.task"
src_model="project.project"
view_mode="tree,form,calendar,graph"
view_type="form"/>
- <act_window id="act_project_project_2_project_task_all" name="All tasks" res_model="project.task" src_model="project.project" view_mode="tree,form" view_type="form"/>
-
<record id="task_company" model="ir.ui.view">
<field name="name">res.company.task.config</field>
<field name="model">res.company</field>
diff --git a/addons/project/report/__init__.py b/addons/project/report/__init__.py
index 9c8d5c171fa..6b4e80c3716 100644
--- a/addons/project/report/__init__.py
+++ b/addons/project/report/__init__.py
@@ -1,31 +1,24 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
-# Copyright (c) 2004-2008 Tiny SPRL (http://tiny.be) All Rights Reserved.
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
+# $Id$
#
-# $Id$
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
+# 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 General Public License for more details.
#
-# This program is Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-# 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 General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-###############################################################################
+##############################################################################
import gantt_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project/report/_date_compute.py b/addons/project/report/_date_compute.py
index f5f49273f30..8898313a93b 100644
--- a/addons/project/report/_date_compute.py
+++ b/addons/project/report/_date_compute.py
@@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
-# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
+# $Id$
#
-# $Id$
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
+# 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 General Public License for more details.
#
-# This program is Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# 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 General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
diff --git a/addons/project/report/gantt.py b/addons/project/report/gantt.py
index 0bdcdc92b3b..801f61a14f2 100644
--- a/addons/project/report/gantt.py
+++ b/addons/project/report/gantt.py
@@ -1,31 +1,24 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
-# Copyright (c) 2004-2008 Tiny SPRL (http://tiny.be) All Rights Reserved.
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
+# $Id$
#
-# $Id$
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
+# 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 General Public License for more details.
#
-# This program is Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-# 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 General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-###############################################################################
+##############################################################################
from mx.DateTime import RelativeDateTime, now, DateTime, localtime
from pychart import *
import pychart.legend
diff --git a/addons/project/report/gantt_report.py b/addons/project/report/gantt_report.py
index 8c3dff58394..bdd25087f3c 100644
--- a/addons/project/report/gantt_report.py
+++ b/addons/project/report/gantt_report.py
@@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
-# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
+# $Id$
#
-# $Id$
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
+# 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 General Public License for more details.
#
-# This program is Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# 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 General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
diff --git a/addons/project/wizard/__init__.py b/addons/project/wizard/__init__.py
index 1cc1cc7ff62..564985c765b 100644
--- a/addons/project/wizard/__init__.py
+++ b/addons/project/wizard/__init__.py
@@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
-# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
+# $Id$
#
-# $Id$
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
+# 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 General Public License for more details.
#
-# This program is Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# 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 General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
diff --git a/addons/project/wizard/close_task.py b/addons/project/wizard/close_task.py
index f3586a2708c..d4b36b9e47c 100644
--- a/addons/project/wizard/close_task.py
+++ b/addons/project/wizard/close_task.py
@@ -1,36 +1,29 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
-# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
+# $Id$
#
-# $Id$
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
+# 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 General Public License for more details.
#
-# This program is Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# 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 General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import wizard
from tools import email_send as email
import pooler
+from osv import osv
mail_form = """<?xml version="1.0" ?>
<form string="Send mail to customer">
diff --git a/addons/project/wizard/task_delegate.py b/addons/project/wizard/task_delegate.py
index a6c2ed3649f..07fa278a460 100644
--- a/addons/project/wizard/task_delegate.py
+++ b/addons/project/wizard/task_delegate.py
@@ -1,30 +1,22 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
-# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
+# $Id$
#
-# $Id$
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
+# 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 General Public License for more details.
#
-# This program is Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# 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 General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@@ -46,13 +38,13 @@ ask_form = """<?xml version="1.0" ?>
</form>"""
ask_fields = {
- 'name': {'string': 'Title', 'type': 'char', 'required': 'True', 'size':64},
- 'prefix': {'string': 'Prefix of Task', 'type': 'char', 'required': 'True', 'size':64},
- 'user_id': {'string':'Assign To', 'type':'many2one', 'relation': 'res.users', 'required':'True'},
- 'include_info': {'string':'Copy Description', 'type':'boolean'},
- 'planned_hours': {'string':'Planned Hours', 'type':'float', 'widget':'float_time'},
- 'planned_hours_me': {'string':'Hours to Validate', 'type':'float', 'widget':'float_time'},
- 'state': {'string':'Validation State', 'type':'selection', 'selection': [('pending','Pending'),('done','Done')]},
+ 'name': {'string': 'Delegated Title', 'type': 'char', 'required': 'True', 'size':64, 'help':"New title of the task delegated to the user."},
+ 'prefix': {'string': 'Your Task Title', 'type': 'char', 'required': 'True', 'size':64, 'help':"New title of your own task to validate the work done."},
+ 'user_id': {'string':'Assign To', 'type':'many2one', 'relation': 'res.users', 'required':'True', 'help':"User you want to delegate this task to."},
+ 'include_info': {'string':'Copy Description', 'type':'boolean', 'help':"Reinclude the description of the task in the task of the user."},
+ 'planned_hours': {'string':'Planned Hours', 'type':'float', 'widget':'float_time', 'help':"Estimated time to close this task by the delegated user."},
+ 'planned_hours_me': {'string':'Hours to Validate', 'type':'float', 'widget':'float_time', 'help':"Estimated time for you to validate the work done by the user to whom you delegate this task."},
+ 'state': {'string':'Validation State', 'type':'selection', 'selection': [('pending','Pending'),('done','Done')], 'help':"New state of your own task. Pending will be reopened automatically when the delegated task is closed.", 'required':True},
}
class wizard_delegate(wizard.interface):
@@ -60,19 +52,20 @@ class wizard_delegate(wizard.interface):
task_obj = pooler.get_pool(cr.dbname).get('project.task')
task = task_obj.browse(cr, uid, data['id'], context)
newname = task.name
- if not task.name.startswith(data['form']['prefix'] or '++'):
- newname = (data['form']['prefix'] or '')+task.name
+ newname = data['form']['prefix'] or ''
task_obj.copy(cr, uid, data['id'], {
'name': data['form']['name'],
'user_id': data['form']['user_id'],
'planned_hours': data['form']['planned_hours'],
+ 'remaining_hours': data['form']['planned_hours'],
'parent_id': data['id'],
'state': 'open',
'description': data['form']['include_info'] and task.description or '',
- 'child_ids': []
+ 'child_ids': [],
+ 'work_ids': []
})
task_obj.write(cr, uid, data['id'], {
- 'planned_hours': data['form']['planned_hours_me'],
+ 'remaining_hours': data['form']['planned_hours_me'],
'name': newname
})
if data['form']['state']=='pending':
@@ -87,9 +80,9 @@ class wizard_delegate(wizard.interface):
return {
'name':task.name,
'user_id': False,
- 'planned_hours': task.planned_hours,
- 'planned_hours_me': task.planned_hours / 5.0,
- 'prefix': 'CHECK: ',
+ 'planned_hours': task.remaining_hours,
+ 'planned_hours_me': 1.0,
+ 'prefix': 'CHECK: '+ (task.name or ''),
'state': 'pending'
}