diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml
index f883f007bd6..84c65777e95 100644
--- a/addons/project/project_view.xml
+++ b/addons/project/project_view.xml
@@ -750,9 +750,9 @@
-
-
-
+
+
+
diff --git a/addons/project/res_config.py b/addons/project/res_config.py
index 035ef600c4f..b112506e073 100644
--- a/addons/project/res_config.py
+++ b/addons/project/res_config.py
@@ -47,7 +47,7 @@ class project_configuration(osv.osv_memory):
'module_project_issue': fields.boolean("Issues and Bug Tracking",
help="""Provides management of issues/bugs in projects.
This installs the module project_issue."""),
- 'time_unit': fields.many2one('product.uom', 'Working Time Unit', required=True,
+ 'time_unit': fields.many2one('product.uom', 'Working Time Unit', required=True,
help="""This will set the unit of measure used in projects and tasks."""),
'module_project_issue_sheet': fields.boolean("Track and Invoice Issues Working Time",
help="""Provides timesheet support for the issues/bugs management in project.
@@ -60,25 +60,16 @@ class project_configuration(osv.osv_memory):
help="Allows you to compute Time Estimation on tasks."),
'group_manage_delegation_task': fields.boolean("Manage Task Delegation",
implied_group='project.group_delegate_task',
- help="Allows you to delegate tasks to other users."),
+ help="Allows you to delegate tasks to other users."),
}
-
-
- def _get_default_time_unit(self, cr, uid, context=None):
- res = {}
- product_uom_obj = self.pool.get('product.uom')
- user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
- res['time_unit'] = user.company_id.project_time_mode_id.id
- return res.get('time_unit', False)
- _defaults = {
- 'time_unit': _get_default_time_unit,
- }
- def set_project_defaults(self, cr, uid, ids, context=None):
- wizard = self.browse(cr, uid, ids)[0]
- if wizard.time_unit:
- user = self.pool.get('res.users').browse(cr, uid, uid, context)
- user.company_id.write({'project_time_mode_id': wizard.time_unit.id})
- return {}
+ def get_default_time_unit(self, cr, uid, fields, context=None):
+ user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
+ return {'time_unit': user.company_id.project_time_mode_id.id}
+
+ def set_time_unit(self, cr, uid, ids, context=None):
+ config = self.browse(cr, uid, ids[0], context)
+ user = self.pool.get('res.users').browse(cr, uid, uid, context)
+ user.company_id.write({'project_time_mode_id': config.time_unit.id})
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: