[IMP] useability timesheets
authorFabien Pinckaers <fp@tinyerp.com>
Mon, 29 Oct 2012 15:08:09 +0000 (16:08 +0100)
committerFabien Pinckaers <fp@tinyerp.com>
Mon, 29 Oct 2012 15:08:09 +0000 (16:08 +0100)
bzr revid: fp@tinyerp.com-20121029150809-86cieq1flmb45ubl

addons/hr/res_config.py
addons/hr_timesheet_sheet/hr_timesheet_sheet.py
addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml

index 1484991..299c5ca 100644 (file)
@@ -42,7 +42,7 @@ class hr_config_settings(osv.osv_memory):
             help ="""This installs the module hr_contract."""),
         'module_hr_evaluation': fields.boolean('Organize employees periodic evaluation',
             help ="""This installs the module hr_evaluation."""),
-        'module_account_analytic_analysis': fields.boolean('Allow invoicing based on timesheets (will install the sale application)',
+        'module_account_analytic_analysis': fields.boolean('Allow invoicing based on timesheets (the sale application will be installed)',
             help ="""This installs the module account_analytic_analysis, which will install sales management too."""),
         'module_hr_payroll': fields.boolean('Manage payroll',
             help ="""This installs the module hr_payroll."""),
index 9902d82..a9276ba 100644 (file)
@@ -79,7 +79,7 @@ class hr_timesheet_sheet(osv.osv):
             if not new_user_id:
                 raise osv.except_osv(_('Error!'), _('In order to create a timesheet for this employee, you must assign it to a user.'))
             if not self._sheet_date(cr, uid, ids, forced_user_id=new_user_id):
-                raise osv.except_osv(_('Error!'), _('You cannot have 2 timesheets that overlaps!\nYou should use the menu \'My Timesheet\' to avoid this problem.'))
+                raise osv.except_osv(_('Error!'), _('You cannot have 2 timesheets that overlap!\nYou should use the menu \'My Timesheet\' to avoid this problem.'))
             if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).product_id:
                 raise osv.except_osv(_('Error!'), _('In order to create a timesheet for this employee, you must link the employee to a product.'))
             if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).journal_id:
@@ -187,7 +187,7 @@ class hr_timesheet_sheet(osv.osv):
 
 
     _constraints = [
-        (_sheet_date, 'You cannot have 2 timesheets that overlaps !\nPlease use the menu \'My Current Timesheet\' to avoid this problem.', ['date_from','date_to']),
+        (_sheet_date, 'You cannot have 2 timesheets that overlap!\nPlease use the menu \'My Current Timesheet\' to avoid this problem.', ['date_from','date_to']),
     ]
 
     def action_set_to_draft(self, cr, uid, ids, *args):
index 098853f..ee5a329 100644 (file)
         </record>
 
         <act_window
-        context="{'search_default_sheet_id': [active_id]}"
-        id="act_hr_timesheet_sheet_sheet_by_account"
-        name="Timesheet by Account"
-        res_model="hr_timesheet_sheet.sheet.account"
-        src_model="hr_timesheet_sheet.sheet"/>
+            context="{'search_default_sheet_id': [active_id]}"
+            id="act_hr_timesheet_sheet_sheet_by_account"
+            name="Timesheet by Account"
+            groups="base.group_hr_attendance"
+            res_model="hr_timesheet_sheet.sheet.account"
+            src_model="hr_timesheet_sheet.sheet"/>
 
         <act_window
-        context="{'search_default_sheet_id': [active_id]}"
-        id="act_hr_timesheet_sheet_sheet_by_day"
-        name="Timesheet by Day"
-        res_model="hr_timesheet_sheet.sheet.day"
-        src_model="hr_timesheet_sheet.sheet"/>
+            context="{'search_default_sheet_id': [active_id]}"
+            id="act_hr_timesheet_sheet_sheet_by_day"
+            name="Timesheet by Day"
+            groups="base.group_hr_attendance"
+            res_model="hr_timesheet_sheet.sheet.day"
+            src_model="hr_timesheet_sheet.sheet"/>
+
         <record id="hr_timesheet_sheet_tree_simplified" model="ir.ui.view">
             <field name="name">hr.timesheet.sheet.tree</field>
             <field name="model">hr_timesheet_sheet.sheet</field>