diff --git a/addons/hr/hr.py b/addons/hr/hr.py index a2c4ee3805b..13db46ccc22 100644 --- a/addons/hr/hr.py +++ b/addons/hr/hr.py @@ -142,8 +142,8 @@ class hr_employee(osv.osv): 'work_email': fields.char('Work E-mail', size=240), 'work_location': fields.char('Office Location', size=32), 'notes': fields.text('Notes'), - 'parent_id': fields.many2one('hr.employee', 'Manager'), - 'category_ids': fields.many2many('hr.employee.category', 'employee_category_rel', 'emp_id', 'category_id', 'Category'), + 'parent_id': fields.many2one('hr.employee', 'Manager'), + 'category_ids': fields.many2many('hr.employee.category', 'employee_category_rel', 'emp_id', 'category_id', 'Categories'), 'child_ids': fields.one2many('hr.employee', 'parent_id', 'Subordinates'), 'resource_id': fields.many2one('resource.resource', 'Resource', ondelete='cascade', required=True), 'coach_id': fields.many2one('hr.employee', 'Coach'), @@ -231,7 +231,7 @@ class res_users(osv.osv): except: # Tolerate a missing shortcut. See product/product.py for similar code. logging.getLogger('orm').debug('Skipped meetings shortcut for user "%s"', data.get('name',' + @@ -157,12 +158,12 @@ - - Employees - ir.ui.menu - - - + + Employees + ir.ui.menu + + + Basic @@ -177,7 +49,7 @@ none code - result = heads['BASIC'] + ('ALW' in heads and heads['ALW'] or 0.0) + result = categories['BASIC'] + ('ALW' in categories and categories['ALW'] or 0.0) @@ -187,7 +59,7 @@ none code - result = heads['BASIC'] + ('ALW' in heads and heads['ALW'] or 0.0) + ('DED' in heads and heads['DED'] or 0.0) + result = categories['BASIC'] + ('ALW' in categories and categories['ALW'] or 0.0) + ('DED' in categories and categories['DED'] or 0.0) diff --git a/addons/hr_payroll/hr_payroll_demo.xml b/addons/hr_payroll/hr_payroll_demo.xml index db903fbabfe..5a6ccc2c995 100644 --- a/addons/hr_payroll/hr_payroll_demo.xml +++ b/addons/hr_payroll/hr_payroll_demo.xml @@ -60,6 +60,30 @@ Meal Voucher + + + code + SALE + + Get 1% of sales + + result = (inputs['S-ASUS']['quantity'] + inputs['S-CHINA']['quantity']) * contract.wage * 0.01 + + + + + + S-ASUS + Sale to ASUStek + + + + + S-CHINA + Sale to China Export + + + diff --git a/addons/hr_payroll/hr_payroll_view.xml b/addons/hr_payroll/hr_payroll_view.xml index 8082418b963..27fa0d15bc2 100644 --- a/addons/hr_payroll/hr_payroll_view.xml +++ b/addons/hr_payroll/hr_payroll_view.xml @@ -193,7 +193,7 @@ - + @@ -260,8 +260,8 @@ - - + + @@ -272,7 +272,7 @@ - + @@ -281,6 +281,36 @@ +
+ + + + + + + + + +
+
+ + + + + + + + +
+ + + + + + + + +
@@ -347,64 +377,62 @@ - - - hr.salary.head.form - hr.salary.head + + + hr.salary.rule.category.form + hr.salary.rule.category form -
+ - - +
- - hr.salary.head.tree - hr.salary.head + + + hr.salary.rule.category.tree + hr.salary.rule.category tree - + - - + - - hr.salary.head.select - hr.salary.head + + hr.salary.rule.category.select + hr.salary.rule.category search - + - - Salary Heads - hr.salary.head + + Salary Rule Categories + hr.salary.rule.category form - - + + - - + hr.salary.rule.tree hr.salary.rule tree @@ -504,86 +532,94 @@
- - hr.salary.rule.form - hr.salary.rule - form - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
+ + hr.salary.rule.form + hr.salary.rule + form + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
- - hr.salary.rule.select - hr.salary.rule - search - - - - - - - - - - - - - - - + + hr.salary.rule.select + hr.salary.rule + search + + + + + + + + + + + + + + + - - Salary Rules - hr.salary.rule - form - - [('parent_rule_id','=',False)] - - + + Salary Rules + hr.salary.rule + form + + [('parent_rule_id','=',False)] + + - + - + hr.payslip.run.search diff --git a/addons/hr_payroll/security/hr_security.xml b/addons/hr_payroll/security/hr_security.xml index 339fb1961b9..d55f1c81cce 100644 --- a/addons/hr_payroll/security/hr_security.xml +++ b/addons/hr_payroll/security/hr_security.xml @@ -6,5 +6,12 @@ + + Employee Payslip + + ['|', ('employee_id.user_id', '=', user.id), ('employee_id.department_id.manager_id.user_id', '=', user.id)] + + + \ No newline at end of file diff --git a/addons/hr_payroll/security/ir.model.access.csv b/addons/hr_payroll/security/ir.model.access.csv index d3f794089c2..d19ec411d5d 100644 --- a/addons/hr_payroll/security/ir.model.access.csv +++ b/addons/hr_payroll/security/ir.model.access.csv @@ -1,13 +1,15 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" "access_hr_payroll_structure","hr.payroll.structure","model_hr_payroll_structure","base.group_hr_user",1,1,1,1 "access_hr_contribution_register","hr.contribution.register","model_hr_contribution_register","base.group_hr_user",1,1,1,1 -"access_hr_salary_head","hr.salary.head","model_hr_salary_head","base.group_hr_user",1,1,1,1 +"access_hr_salary_rule_category","hr.salary.rule.category","model_hr_salary_rule_category","base.group_hr_user",1,1,1,1 "access_hr_payslip","hr.payslip","model_hr_payslip","base.group_hr_user",1,1,1,1 "access_hr_payslip_line","hr.payslip.line","model_hr_payslip_line","base.group_hr_user",1,1,1,1 -"access_res_partner_payroll","res.partner.payroll","base.model_res_partner","base.group_hr_user",1,1,1,1 +"access_hr_payslip_input_user","hr.payslip.input.user","model_hr_payslip_input","base.group_hr_user",1,1,1,1 "access_hr_payslip_manager","hr.payslip.manager","model_hr_payslip","base.group_hr_manager",1,1,1,1 "access_hr_payslip_line_manager","hr.payslip.line.manager","model_hr_payslip_line","base.group_hr_manager",1,1,1,1 "access_hr_payroll_structure_manager","hr.payroll.structure.manager","model_hr_payroll_structure","base.group_hr_manager",1,1,1,1 -"access_hr_payslip_input ","hr.payslip.input","model_hr_payslip_input","base.group_hr_manager",1,1,1,1 +"access_hr_payslip_worked_days ","hr.payslip.worked_days","model_hr_payslip_worked_days","base.group_hr_manager",1,1,1,1 "access_hr_salary_rule","hr.salary.rule","model_hr_salary_rule","base.group_hr_manager",1,1,1,1 "access_hr_payslip_run","hr.payslip.run","model_hr_payslip_run","base.group_hr_manager",1,1,1,1 +"access_hr_payslip_input","hr.payslip.input","model_hr_payslip_input","base.group_hr_manager",1,1,1,1 +"access_hr_rule_input","hr.rule.input","model_hr_rule_input","base.group_hr_manager",1,1,1,1 diff --git a/addons/hr_payroll/wizard/hr_payroll_payslips_by_employees.py b/addons/hr_payroll/wizard/hr_payroll_payslips_by_employees.py index 8413bb81f61..0f0c42095d2 100644 --- a/addons/hr_payroll/wizard/hr_payroll_payslips_by_employees.py +++ b/addons/hr_payroll/wizard/hr_payroll_payslips_by_employees.py @@ -52,7 +52,8 @@ class hr_payslip_employees(osv.osv_memory): 'struct_id': slip_data['value'].get('struct_id', False), 'contract_id': slip_data['value'].get('contract_id', False), 'payslip_run_id': context.get('active_id', False), - 'input_line_ids': [(0, 0, x) for x in slip_data['value'].get('input_line_ids', False)] + 'input_line_ids': [(0, 0, x) for x in slip_data['value'].get('input_line_ids', False)], + 'worked_days_line_ids': [(0, 0, x) for x in slip_data['value'].get('worked_days_line_ids', False)] } slip_ids.append(slip_pool.create(cr, uid, res, context=context)) slip_pool.compute_sheet(cr, uid, slip_ids, context=context)