~openerp-commiter/openobject-addons/trunk-review-purchase-form-dbr-review-hsa

« back to all changes in this revision

Viewing changes to project/res_config.py

[MERGE] trunk-application_setting_cleanup-atp (clean up config wizards, and adapt forms to new style)

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
##############################################################################
21
21
 
22
22
from osv import osv, fields
 
23
from tools.translate import _
23
24
 
24
25
class project_configuration(osv.osv_memory):
25
26
    _name = 'project.config.settings'
46
47
        'module_project_issue': fields.boolean("Issues and Bug Tracking",
47
48
            help="""Provides management of issues/bugs in projects.
48
49
                This installs the module project_issue."""),
 
50
        'time_unit': fields.many2one('product.uom', 'Working Time Unit', required=True,
 
51
            help="""This will set the unit of measure used in projects and tasks."""),
49
52
        'module_project_issue_sheet': fields.boolean("Track and Invoice Issues Working Time",
50
53
            help="""Provides timesheet support for the issues/bugs management in project.
51
54
                This installs the module project_issue_sheet."""),
55
58
        'group_time_work_estimation_tasks': fields.boolean("Time Estimation on Tasks",
56
59
            implied_group='project.group_time_work_estimation_tasks',
57
60
            help="Allows you to compute Time Estimation on tasks."),
58
 
        'group_manage_delegation_task': fields.boolean("Manage Taks Delegation",
 
61
        'group_manage_delegation_task': fields.boolean("Manage Task Delegation",
59
62
            implied_group='project.group_delegate_task',
60
 
            help="Allows you to delegate tasks to other users."),                                
 
63
            help="Allows you to delegate tasks to other users."),
61
64
    }
62
65
 
 
66
    def get_default_time_unit(self, cr, uid, fields, context=None):
 
67
        user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
 
68
        return {'time_unit': user.company_id.project_time_mode_id.id}
 
69
 
 
70
    def set_time_unit(self, cr, uid, ids, context=None):
 
71
        config = self.browse(cr, uid, ids[0], context)
 
72
        user = self.pool.get('res.users').browse(cr, uid, uid, context)
 
73
        user.company_id.write({'project_time_mode_id': config.time_unit.id})
 
74
 
63
75
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: