summaryrefslogtreecommitdiff
path: root/addons/project
diff options
context:
space:
mode:
authorDivyesh Makwana (Open ERP) <mdi@tinyerp.com>2012-04-12 12:06:52 +0530
committerDivyesh Makwana (Open ERP) <mdi@tinyerp.com>2012-04-12 12:06:52 +0530
commit492c856bbcec5a855bcf38dd2dbd26c0892e8b24 (patch)
tree6e2398a1a5bacc60a26c702c231783fa204d0140 /addons/project
parent2df24b6d9212e2a52d75e616db668dce7afa75ef (diff)
parente44315701dd1bdb6996f24c40be7ac0640aaffe5 (diff)
[Merge] Merge with main branch
bzr revid: mdi@tinyerp.com-20120412063652-e4vgtl5cbr117c4g
Diffstat (limited to 'addons/project')
-rw-r--r--addons/project/__init__.py1
-rw-r--r--addons/project/__openerp__.py4
-rw-r--r--addons/project/project.py166
-rw-r--r--addons/project/project_demo.xml25
-rw-r--r--addons/project/project_installer.xml40
-rw-r--r--addons/project/project_view.xml9
-rw-r--r--addons/project/res_config.py54
-rw-r--r--addons/project/res_config_view.xml44
-rw-r--r--addons/project/security/project_security.xml1
9 files changed, 250 insertions, 94 deletions
diff --git a/addons/project/__init__.py b/addons/project/__init__.py
index 01bef264e02..becd17f0b78 100644
--- a/addons/project/__init__.py
+++ b/addons/project/__init__.py
@@ -24,5 +24,6 @@ import company
import report
import wizard
import res_partner
+import res_config
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project/__openerp__.py b/addons/project/__openerp__.py
index 96a7dc4f28f..35b920828b2 100644
--- a/addons/project/__openerp__.py
+++ b/addons/project/__openerp__.py
@@ -52,12 +52,12 @@ Dashboard for project members that includes:
"project_data.xml",
"project_view.xml",
"process/task_process.xml",
- "project_installer.xml",
"res_partner_view.xml",
"report/project_report_view.xml",
"board_project_view.xml",
'board_project_manager_view.xml',
- 'report/project_cumulative.xml'
+ 'report/project_cumulative.xml',
+ 'res_config_view.xml',
],
'demo_xml': [
'project_demo.xml',
diff --git a/addons/project/project.py b/addons/project/project.py
index cff36d2b072..c9cd49e54b9 100644
--- a/addons/project/project.py
+++ b/addons/project/project.py
@@ -59,6 +59,7 @@ class project(osv.osv):
_name = "project.project"
_description = "Project"
_inherits = {'account.analytic.account': "analytic_account_id"}
+ _inherit = ['ir.needaction_mixin', 'mail.thread']
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False):
if user == 1:
@@ -230,9 +231,7 @@ class project(osv.osv):
task_ids = task_obj.search(cr, uid, [('project_id', 'in', ids), ('state', 'not in', ('cancelled', 'done'))])
task_obj.write(cr, uid, task_ids, {'state': 'done', 'date_end':time.strftime('%Y-%m-%d %H:%M:%S'), 'remaining_hours': 0.0})
self.write(cr, uid, ids, {'state':'close'}, context=context)
- for (id, name) in self.name_get(cr, uid, ids):
- message = _("The project '%s' has been closed.") % name
- self.log(cr, uid, id, message)
+ self.set_close_send_note(cr, uid, ids, context=context)
return True
def set_cancel(self, cr, uid, ids, context=None):
@@ -240,23 +239,24 @@ class project(osv.osv):
task_ids = task_obj.search(cr, uid, [('project_id', 'in', ids), ('state', '!=', 'done')])
task_obj.write(cr, uid, task_ids, {'state': 'cancelled', 'date_end':time.strftime('%Y-%m-%d %H:%M:%S'), 'remaining_hours': 0.0})
self.write(cr, uid, ids, {'state':'cancelled'}, context=context)
+ self.set_cancel_send_note(cr, uid, ids, context=context)
return True
def set_pending(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, {'state':'pending'}, context=context)
+ self.set_pending_send_note(cr, uid, ids, context=context)
return True
def set_open(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, {'state':'open'}, context=context)
+ self.set_open_send_note(cr, uid, ids, context=context)
return True
def reset_project(self, cr, uid, ids, context=None):
res = self.setActive(cr, uid, ids, value=True, context=context)
- for (id, name) in self.name_get(cr, uid, ids):
- message = _("The project '%s' has been opened.") % name
- self.log(cr, uid, id, message)
+ self.set_open_send_note(cr, uid, ids, context=context)
return res
-
+
def map_tasks(self, cr, uid, old_project_id, new_project_id, context=None):
""" copy and map tasks from old to new project """
if context is None:
@@ -266,7 +266,7 @@ class project(osv.osv):
proj = self.browse(cr, uid, old_project_id, context=context)
for task in proj.tasks:
map_task_id[task.id] = task_obj.copy(cr, uid, task.id, {}, context=context)
- self.write(cr, uid, new_project_id, {'tasks':[(6,0, map_task_id.values())]})
+ self.write(cr, uid, [new_project_id], {'tasks':[(6,0, map_task_id.values())]})
task_obj.duplicate_task(cr, uid, map_task_id, context=context)
return True
@@ -448,6 +448,50 @@ def Project():
'user_id': int(p.booked_resource[0].name[5:]),
}, context=context)
return True
+
+ # ------------------------------------------------
+ # OpenChatter methods and notifications
+ # ------------------------------------------------
+
+ def get_needaction_user_ids(self, cr, uid, ids, context=None):
+ result = dict.fromkeys(ids)
+ for obj in self.browse(cr, uid, ids, context=context):
+ result[obj.id] = []
+ if obj.state == 'draft' and obj.user_id:
+ result[obj.id] = [obj.user_id.id]
+ return result
+
+ def message_get_subscribers(self, cr, uid, ids, context=None):
+ sub_ids = self.message_get_subscribers_ids(cr, uid, ids, context=context);
+ for obj in self.browse(cr, uid, ids, context=context):
+ if obj.user_id:
+ sub_ids.append(obj.user_id.id)
+ return self.pool.get('res.users').read(cr, uid, sub_ids, context=context)
+
+ def create(self, cr, uid, vals, context=None):
+ obj_id = super(project, self).create(cr, uid, vals, context=context)
+ self.create_send_note(cr, uid, [obj_id], context=context)
+ return obj_id
+
+ def create_send_note(self, cr, uid, ids, context=None):
+ return self.message_append_note(cr, uid, ids, body=_("Project has been <b>created</b>."), context=context)
+
+ def set_open_send_note(self, cr, uid, ids, context=None):
+ message = _("Project has been <b>opened</b>.")
+ return self.message_append_note(cr, uid, ids, body=message, context=context)
+
+ def set_pending_send_note(self, cr, uid, ids, context=None):
+ message = _("Project is now <b>pending</b>.")
+ return self.message_append_note(cr, uid, ids, body=message, context=context)
+
+ def set_cancel_send_note(self, cr, uid, ids, context=None):
+ message = _("Project has been <b>cancelled</b>.")
+ return self.message_append_note(cr, uid, ids, body=message, context=context)
+
+ def set_close_send_note(self, cr, uid, ids, context=None):
+ message = _("Project has been <b>closed</b>.")
+ return self.message_append_note(cr, uid, ids, body=message, context=context)
+
project()
class users(osv.osv):
@@ -462,6 +506,7 @@ class task(osv.osv):
_description = "Task"
_log_create = True
_date_name = "date_start"
+ _inherit = ['ir.needaction_mixin', 'mail.thread']
def _resolve_project_id_from_context(self, cr, uid, context=None):
@@ -848,8 +893,7 @@ class task(osv.osv):
if not task.date_end:
vals.update({ 'date_end':time.strftime('%Y-%m-%d %H:%M:%S')})
self.write(cr, uid, [task.id],vals, context=context)
- message = _("The task '%s' is done") % (task.name,)
- self.log(cr, uid, task.id, message)
+ self.do_close_send_note(cr, uid, [task.id], context)
return True
def do_reopen(self, cr, uid, ids, context=None):
@@ -869,6 +913,7 @@ class task(osv.osv):
}, context=context)
self.write(cr, uid, [task.id], {'state': 'open'}, context=context)
+ self.do_open_send_note(cr, uid, [task.id], context)
return True
def do_cancel(self, cr, uid, ids, context={}):
@@ -887,9 +932,8 @@ class task(osv.osv):
'ref_doc1': 'project.task,%d' % task.id,
'ref_doc2': 'project.project,%d' % project.id,
}, context=context)
- message = _("The task '%s' is cancelled.") % (task.name,)
- self.log(cr, uid, task.id, message)
self.write(cr, uid, [task.id], {'state': 'cancelled', 'remaining_hours':0.0}, context=context)
+ self.do_cancel_send_note(cr, uid, [task.id], context)
return True
def do_open(self, cr, uid, ids, context={}):
@@ -900,12 +944,12 @@ class task(osv.osv):
if not t.date_start:
data['date_start'] = time.strftime('%Y-%m-%d %H:%M:%S')
self.write(cr, uid, [t.id], data, context=context)
- message = _("The task '%s' is opened.") % (t.name,)
- self.log(cr, uid, t.id, message)
+ self.do_open_send_note(cr, uid, [t.id], context)
return True
def do_draft(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state': 'draft'}, context=context)
+ self.do_draft_send_note(cr, uid, ids, context)
return True
@@ -916,7 +960,7 @@ class task(osv.osv):
for attachment_id in attachment_ids:
new_attachment_ids.append(attachment.copy(cr, uid, attachment_id, default={'res_id': delegated_task_id}, context=context))
return new_attachment_ids
-
+
def do_delegate(self, cr, uid, ids, delegate_data={}, context=None):
"""
@@ -944,20 +988,16 @@ class task(osv.osv):
'name': newname,
}, context=context)
if delegate_data['state'] == 'pending':
- self.do_pending(cr, uid, task.id, context=context)
+ self.do_pending(cr, uid, [task.id], context=context)
elif delegate_data['state'] == 'done':
- self.do_close(cr, uid, task.id, context=context)
-
- message = _("The task '%s' has been delegated to %s.") % (delegate_data['name'], delegate_data['user_id'][1])
- self.log(cr, uid, task.id, message)
+ self.do_close(cr, uid, [task.id], context=context)
+ self.do_delegation_send_note(cr, uid, [task.id], context)
delegated_tasks[task.id] = delegated_task_id
return delegated_tasks
def do_pending(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state': 'pending'}, context=context)
- for (id, name) in self.name_get(cr, uid, ids):
- message = _("The task '%s' is pending.") % name
- self.log(cr, uid, id, message)
+ self.do_pending_send_note(cr, uid, ids, context)
return True
def set_remaining_time(self, cr, uid, ids, remaining_time=1.0, context=None):
@@ -988,7 +1028,7 @@ class task(osv.osv):
def set_kanban_state_done(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, {'kanban_state': 'done'}, context=context)
- def _change_type(self, cr, uid, ids, next, *args):
+ def _change_type(self, cr, uid, ids, next, context=None):
"""
go to the next stage
if next is False, go to previous stage
@@ -1009,13 +1049,14 @@ class task(osv.osv):
elif typeid and typeid in sorted_types and sorted_types.index(typeid) != len(sorted_types)-1:
index = sorted_types.index(typeid)
self.write(cr, uid, task.id, {'type_id': sorted_types[index+1]})
+ self.state_change_send_note(cr, uid, [task.id], context)
return True
- def next_type(self, cr, uid, ids, *args):
- return self._change_type(cr, uid, ids, True, *args)
+ def next_type(self, cr, uid, ids, context=None):
+ return self._change_type(cr, uid, ids, True, context=context)
- def prev_type(self, cr, uid, ids, *args):
- return self._change_type(cr, uid, ids, False, *args)
+ def prev_type(self, cr, uid, ids, context=None):
+ return self._change_type(cr, uid, ids, False, context=context)
def _store_history(self, cr, uid, ids, context=None):
for task in self.browse(cr, uid, ids, context=context):
@@ -1032,9 +1073,10 @@ class task(osv.osv):
return True
def create(self, cr, uid, vals, context=None):
- result = super(task, self).create(cr, uid, vals, context=context)
- self._store_history(cr, uid, [result], context=context)
- return result
+ task_id = super(task, self).create(cr, uid, vals, context=context)
+ self._store_history(cr, uid, [task_id], context=context)
+ self.create_send_note(cr, uid, [task_id], context=context)
+ return task_id
# Overridden to reset the kanban_state to normal whenever
# the stage (type_id) of the task changes.
@@ -1045,13 +1087,14 @@ class task(osv.osv):
new_stage = vals.get('type_id')
vals_reset_kstate = dict(vals, kanban_state='normal')
for t in self.browse(cr, uid, ids, context=context):
- write_vals = vals_reset_kstate if t.type_id != new_stage else vals
+ write_vals = vals_reset_kstate if t.type_id != new_stage else vals
super(task,self).write(cr, uid, [t.id], write_vals, context=context)
result = True
else:
result = super(task,self).write(cr, uid, ids, vals, context=context)
if ('type_id' in vals) or ('remaining_hours' in vals) or ('user_id' in vals) or ('state' in vals) or ('kanban_state' in vals):
self._store_history(cr, uid, ids, context=context)
+ self.state_change_send_note(cr, uid, ids, context)
return result
def unlink(self, cr, uid, ids, context=None):
@@ -1087,6 +1130,62 @@ class task(osv.osv):
result += "\n"
return result
+
+ # ---------------------------------------------------
+ # OpenChatter methods and notifications
+ # ---------------------------------------------------
+
+ def get_needaction_user_ids(self, cr, uid, ids, context=None):
+ result = dict.fromkeys(ids, [])
+ for obj in self.browse(cr, uid, ids, context=context):
+ if obj.state == 'draft' and obj.user_id:
+ result[obj.id] = [obj.user_id.id]
+ return result
+
+ def message_get_subscribers(self, cr, uid, ids, context=None):
+ sub_ids = self.message_get_subscribers_ids(cr, uid, ids, context=context);
+ for obj in self.browse(cr, uid, ids, context=context):
+ if obj.user_id:
+ sub_ids.append(obj.user_id.id)
+ if obj.manager_id:
+ sub_ids.append(obj.manager_id.id)
+ return self.pool.get('res.users').read(cr, uid, sub_ids, context=context)
+
+ def create_send_note(self, cr, uid, ids, context=None):
+ return self.message_append_note(cr, uid, ids, body=_("Task has been <b>created</b>."), context=context)
+
+ def do_pending_send_note(self, cr, uid, ids, context=None):
+ if not isinstance(ids,list): ids = [ids]
+ msg = _('Task is now <b>pending</b>.')
+ return self.message_append_note(cr, uid, ids, body=msg, context=context)
+
+ def do_open_send_note(self, cr, uid, ids, context=None):
+ msg = _('Task has been <b>opened</b>.')
+ return self.message_append_note(cr, uid, ids, body=msg, context=context)
+
+ def do_cancel_send_note(self, cr, uid, ids, context=None):
+ msg = _('Task has been <b>canceled</b>.')
+ return self.message_append_note(cr, uid, ids, body=msg, context=context)
+
+ def do_close_send_note(self, cr, uid, ids, context=None):
+ msg = _('Task has been <b>closed</b>.')
+ return self.message_append_note(cr, uid, ids, body=msg, context=context)
+
+ def do_draft_send_note(self, cr, uid, ids, context=None):
+ msg = _('Task has been <b>renewed</b>.')
+ return self.message_append_note(cr, uid, ids, body=msg, context=context)
+
+ def do_delegation_send_note(self, cr, uid, ids, context=None):
+ for task in self.browse(cr, uid, ids, context=context):
+ msg = _('Task has been <b>delegated</b> to <em>%s</em>.') % (task.user_id.name)
+ self.message_append_note(cr, uid, [task.id], body=msg, context=context)
+ return True
+
+ def state_change_send_note(self, cr, uid, ids, context=None):
+ for task in self.browse(cr, uid, ids, context=context):
+ msg = _('Stage changed to <b>%s</b>') % (task.type_id.name)
+ self.message_append_note(cr, uid, [task.id], body=msg, context=context)
+ return True
task()
@@ -1182,7 +1281,7 @@ class project_task_history(osv.osv):
for history in self.browse(cr, uid, ids, context=context):
cr.execute('''select
id
- from
+ from
project_task_history
where
task_id=%s and
@@ -1238,4 +1337,3 @@ class project_task_history_cumulative(osv.osv):
)
""")
project_task_history_cumulative()
-
diff --git a/addons/project/project_demo.xml b/addons/project/project_demo.xml
index 28d451b9ee0..2f8c9e9638a 100644
--- a/addons/project/project_demo.xml
+++ b/addons/project/project_demo.xml
@@ -190,7 +190,7 @@
<field name="type_id" ref="project_tt_merge"/>
</record>
- <function model="project.task" name="do_close" eval="[ref('project_task_11')]"/>
+ <function model="project.task" name="do_close" eval="[ref('project_task_11')], {'install_mode': True}"/>
<record id="project_task_12" model="project.task">
<field eval="20.0" name="planned_hours"/>
@@ -202,7 +202,7 @@
<field name="type_id" ref="project_tt_development"/>
</record>
- <function model="project.task" name="do_close" eval="[ref('project_task_12')]"/>
+ <function model="project.task" name="do_close" eval="[ref('project_task_12')], {'install_mode': True}"/>
<record id="project_task_13" model="project.task">
<field eval="50.0" name="planned_hours"/>
@@ -214,7 +214,7 @@
<field name="type_id" ref="project_tt_development"/>
</record>
- <function model="project.task" name="do_pending" eval="[ref('project_task_13')]"/>
+ <function model="project.task" name="do_pending" eval="[ref('project_task_13')], {'install_mode': True}"/>
<record id="project_task_14" model="project.task">
<field eval="30.0" name="planned_hours"/>
@@ -249,7 +249,7 @@
<field name="description">Test on Runbot</field>
<field name="type_id" ref="project_tt_specification"/>
</record>
- <function model="project.task" name="do_open" eval="[ref('project_task_16')]"/>
+ <function model="project.task" name="do_open" eval="[ref('project_task_16')], {'install_mode': True}"/>
<record id="project_task_17" model="project.task">
<field eval="5.0" name="planned_hours"/>
@@ -260,7 +260,7 @@
<field name="name">Deploy and Review on Customer System</field>
<field name="type_id" ref="project_tt_specification"/>
</record>
- <function model="project.task" name="do_open" eval="[ref('project_task_17')]"/>
+ <function model="project.task" name="do_open" eval="[ref('project_task_17')], {'install_mode': True}"/>
<record id="project_task_18" model="project.task">
<field eval="10.0" name="planned_hours"/>
@@ -328,7 +328,7 @@
<field name="description">BoM, After sales returns, interventions. Traceability.</field>
<field name="name">Specific adaptation to MRP</field>
</record>
- <function model="project.task" name="do_open" eval="[ref('project_task_116')]"/>
+ <function model="project.task" name="do_open" eval="[ref('project_task_116')], {'install_mode': True}"/>
<record id="project_task_130" model="project.task">
<field name="planned_hours">16.0</field>
@@ -338,7 +338,7 @@
<field name="project_id" ref="project_project_23"/>
<field name="name">Data importation + Doc</field>
</record>
- <function model="project.task" name="do_open" eval="[ref('project_task_130')]"/>
+ <function model="project.task" name="do_open" eval="[ref('project_task_130')], {'install_mode': True}"/>
<record id="project_task_131" model="project.task">
<field name="planned_hours">16.0</field>
@@ -348,7 +348,7 @@
<field name="project_id" ref="project_project_23"/>
<field name="name">Modifications asked by the customer.</field>
</record>
- <function model="project.task" name="do_open" eval="[ref('project_task_131')]"/>
+ <function model="project.task" name="do_open" eval="[ref('project_task_131')], {'install_mode': True}"/>
<record id="project_task_184" model="project.task">
<field name="planned_hours">16.0</field>
@@ -380,7 +380,7 @@
<field name="project_id" ref="project_project_21"/>
<field name="name">Analysis, Data Importation</field>
</record>
- <function model="project.task" name="do_open" eval="[ref('project_task_188')]"/>
+ <function model="project.task" name="do_open" eval="[ref('project_task_188')], {'install_mode': True}"/>
<record id="project_task_189" model="project.task">
<field name="sequence">20</field>
@@ -391,7 +391,7 @@
<field name="name">Parameters</field>
<field name="type_id" ref="project_tt_specification"/>
</record>
- <function model="project.task" name="do_open" eval="[ref('project_task_189')]"/>
+ <function model="project.task" name="do_open" eval="[ref('project_task_189')], {'install_mode': True}"/>
<record id="project_task_190" model="project.task">
<field name="sequence">20</field>
@@ -405,8 +405,9 @@
</record>
<!-- Schedule tasks to assign users and dates -->
-
- <function model="project.project" name="schedule_tasks" eval="[[ref('project_project_21'), ref('project_project_22'), ref('project_project_23')]]"/>
+ <function model="project.project" name="schedule_tasks"
+ eval="[ref('project_project_21'), ref('project_project_22'), ref('project_project_23')], {'install_mode': True}"
+ />
</data>
</openerp>
diff --git a/addons/project/project_installer.xml b/addons/project/project_installer.xml
deleted file mode 100644
index 338040df5e2..00000000000
--- a/addons/project/project_installer.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<openerp>
- <data>
-
-
- <record id="category_project_config" model="ir.actions.todo.category">
- <field name="name">Project Management</field>
- <field name="sequence">7</field>
- </record>
-
- <record id="action_create_initial_projects_installer" model="ir.actions.act_window">
- <field name="name">Create your Firsts Projects</field>
- <field name="type">ir.actions.act_window</field>
- <field name="res_model">project.project</field>
- <field name="view_type">form</field>
- <field name="view_mode">tree,form</field>
- </record>
-
- <record id="config_wizard_action_create_initial_projects_installer" model="ir.actions.todo">
- <field name="action_id" ref="action_create_initial_projects_installer"/>
- <field name="category_id" ref="category_project_config" />
- </record>
-
- <record id="action_review_task_stage" model="ir.actions.act_window">
- <field name="name">Review Task Stages</field>
- <field name="type">ir.actions.act_window</field>
- <field name="res_model">project.task.type</field>
- <field name="view_type">form</field>
- <field name="view_mode">tree,form</field>
- <field name="context">{'search_default_common': 1, 'default_project_default': 1}</field>
- <field name="domain">[]</field>
- <field name="help">The stages can be common to all project or specific to one project. Each task will follow the different stages in order to be closed.</field>
- </record>
-
- <record id="config_wizard_action_review_task_stage" model="ir.actions.todo">
- <field name="action_id" ref="action_review_task_stage"/>
- <field name="category_id" ref="category_project_config" />
- </record>
- </data>
-</openerp>
diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml
index be65b29f7b2..adb50512168 100644
--- a/addons/project/project_view.xml
+++ b/addons/project/project_view.xml
@@ -96,6 +96,7 @@
</page>
</notebook>
<newline/>
+ <field name="message_ids_social" colspan="4" widget="ThreadView" nolabel="1"/>
</form>
</field>
</record>
@@ -291,12 +292,7 @@
<field name="priority"/>
<field name="sequence"/>
</group>
- <group colspan="2" col="2" groups="base.group_no_one">
- <separator string="Dates" colspan="2"/>
- <field name="date_start"/>
- <field name="date_end"/>
- <field name="create_date"/>
- </group>
+
<separator string="Miscelleanous" colspan="4"/>
<field name="partner_id" />
<field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
@@ -309,6 +305,7 @@
<field colspan="4" name="notes" nolabel="1"/>
</page>
</notebook>
+ <field name="message_ids_social" colspan="4" widget="ThreadView" nolabel="1"/>
</form>
</field>
</record>
diff --git a/addons/project/res_config.py b/addons/project/res_config.py
new file mode 100644
index 00000000000..17f3a1cfbb5
--- /dev/null
+++ b/addons/project/res_config.py
@@ -0,0 +1,54 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Business Applications
+# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
+#
+# 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 <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import osv, fields
+
+class project_configuration(osv.osv_memory):
+ _name = 'project.config.settings'
+ _inherit = 'res.config.settings'
+
+ _columns = {
+ 'module_project_mrp': fields.boolean('Create Tasks from a Sale Order',
+ help ="""This feature automatically creates project tasks from service products in sale orders.
+ More precisely, tasks are created for procurement lines with product of type 'Service',
+ procurement method 'Make to Order', and supply method 'Produce'.
+ This installs the module project_mrp."""),
+ 'module_pad': fields.boolean("Use Collaborative Note Pads for Tasks",
+ help="""Lets the company customize which Pad installation should be used to link to new pads
+ (by default, http://ietherpad.com/).
+ This installs the module pad."""),
+ 'module_project_timesheet': fields.boolean("Timesheets and Invoices",
+ help="""This allows you to transfer the entries under tasks defined for Project Management to
+ the timesheet line entries for particular date and user, with the effect of creating,
+ editing and deleting either ways.
+ This installs the module project_timesheet."""),
+ 'module_project_long_term': fields.boolean("Manage Gantt and Resource Planning",
+ help="""A long term project management module that tracks planning, scheduling, and resource allocation.
+ This installs the module project_long_term."""),
+ 'module_project_issue': fields.boolean("Issues and Bug Tracking",
+ help="""Provides management of issues/bugs in projects.
+ This installs the module project_issue."""),
+ 'module_project_issue_sheet': fields.boolean("Track and invoice issues working time",
+ help="""Provides timesheet support for the issues/bugs management in project.
+ This installs the module project_issue_sheet."""),
+ }
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project/res_config_view.xml b/addons/project/res_config_view.xml
new file mode 100644
index 00000000000..daa5bc10d8e
--- /dev/null
+++ b/addons/project/res_config_view.xml
@@ -0,0 +1,44 @@
+<openerp>
+ <data>
+
+ <record id="view_config_settings" model="ir.ui.view">
+ <field name="name">project settings</field>
+ <field name="model">project.config.settings</field>
+ <field name="type">form</field>
+ <field name="priority" eval="20"/>
+ <field name="arch" type="xml">
+ <form string="Configure Project">
+ <separator string="Project" colspan="4"/>
+ <field name="module_project_mrp"/>
+ <field name="module_project_timesheet"/>
+ <field name="module_pad"/>
+
+ <separator string="Planning" colspan="4"/>
+ <field name="module_project_long_term"/>
+
+ <separator string="Helpdesk and support" colspan="4"/>
+ <field name="module_project_issue"/>
+ <field name="module_project_issue_sheet"/>
+ <group name="support" colspan="4"/>
+
+ <newline/>
+ <label colspan="2"/>
+ <button string="Cancel" icon="gtk-cancel" special="cancel"/>
+ <button string="Apply" icon="gtk-apply" type="object" name="execute"/>
+ </form>
+ </field>
+ </record>
+
+ <record id="action_config_settings" model="ir.actions.act_window">
+ <field name="name">Configure Project</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">project.config.settings</field>
+ <field name="view_mode">form</field>
+ <field name="target">inline</field>
+ </record>
+
+ <menuitem id="base.menu_project_config" name="Project" parent="base.menu_config"
+ sequence="5" action="action_config_settings"/>
+
+ </data>
+</openerp>
diff --git a/addons/project/security/project_security.xml b/addons/project/security/project_security.xml
index f1e3a6e9b74..a1ead6aa72c 100644
--- a/addons/project/security/project_security.xml
+++ b/addons/project/security/project_security.xml
@@ -11,6 +11,7 @@
<field name="name">Manager</field>
<field name="category_id" ref="base.module_category_project_management"/>
<field name="implied_ids" eval="[(4, ref('group_project_user'))]"/>
+ <field name="users" eval="[(4, ref('base.user_root'))]"/>
</record>
<record model="ir.ui.menu" id="menu_definitions">