[IMP] useability timesheets

bzr revid: fp@tinyerp.com-20121029150809-86cieq1flmb45ubl
This commit is contained in:
Fabien Pinckaers 2012-10-29 16:08:09 +01:00
parent 46e94a312c
commit be779f57d0
3 changed files with 16 additions and 13 deletions

View File

@ -42,7 +42,7 @@ class hr_config_settings(osv.osv_memory):
help ="""This installs the module hr_contract."""), help ="""This installs the module hr_contract."""),
'module_hr_evaluation': fields.boolean('Organize employees periodic evaluation', 'module_hr_evaluation': fields.boolean('Organize employees periodic evaluation',
help ="""This installs the module hr_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."""), help ="""This installs the module account_analytic_analysis, which will install sales management too."""),
'module_hr_payroll': fields.boolean('Manage payroll', 'module_hr_payroll': fields.boolean('Manage payroll',
help ="""This installs the module hr_payroll."""), help ="""This installs the module hr_payroll."""),

View File

@ -79,7 +79,7 @@ class hr_timesheet_sheet(osv.osv):
if not new_user_id: 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.')) 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): 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: 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.')) 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: 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 = [ _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): def action_set_to_draft(self, cr, uid, ids, *args):

View File

@ -303,18 +303,21 @@
</record> </record>
<act_window <act_window
context="{'search_default_sheet_id': [active_id]}" context="{'search_default_sheet_id': [active_id]}"
id="act_hr_timesheet_sheet_sheet_by_account" id="act_hr_timesheet_sheet_sheet_by_account"
name="Timesheet by Account" name="Timesheet by Account"
res_model="hr_timesheet_sheet.sheet.account" groups="base.group_hr_attendance"
src_model="hr_timesheet_sheet.sheet"/> res_model="hr_timesheet_sheet.sheet.account"
src_model="hr_timesheet_sheet.sheet"/>
<act_window <act_window
context="{'search_default_sheet_id': [active_id]}" context="{'search_default_sheet_id': [active_id]}"
id="act_hr_timesheet_sheet_sheet_by_day" id="act_hr_timesheet_sheet_sheet_by_day"
name="Timesheet by Day" name="Timesheet by Day"
res_model="hr_timesheet_sheet.sheet.day" groups="base.group_hr_attendance"
src_model="hr_timesheet_sheet.sheet"/> res_model="hr_timesheet_sheet.sheet.day"
src_model="hr_timesheet_sheet.sheet"/>
<record id="hr_timesheet_sheet_tree_simplified" model="ir.ui.view"> <record id="hr_timesheet_sheet_tree_simplified" model="ir.ui.view">
<field name="name">hr.timesheet.sheet.tree</field> <field name="name">hr.timesheet.sheet.tree</field>
<field name="model">hr_timesheet_sheet.sheet</field> <field name="model">hr_timesheet_sheet.sheet</field>