From ad8437fc0a5879363b6469ce399c72eb03a7f3eb Mon Sep 17 00:00:00 2001 From: "psi (Open ERP)" Date: Thu, 7 Apr 2011 10:55:28 +0530 Subject: [PATCH 1/3] [FIX] hr_contract: Fix yml test bzr revid: psi@tinyerp.co.in-20110407052528-uxz29uxwyjj5kf03 --- addons/hr_contract/test/test_hr_contract.yml | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/addons/hr_contract/test/test_hr_contract.yml b/addons/hr_contract/test/test_hr_contract.yml index 5659eb912ee..398a8c8c4fe 100644 --- a/addons/hr_contract/test/test_hr_contract.yml +++ b/addons/hr_contract/test/test_hr_contract.yml @@ -16,35 +16,16 @@ vehicle: 'No' vehicle_distance: 12 - -- - I create a new Contract wage period. -- - !record {model: hr.contract.wage.type.period, id: hr_contract_wage_type_period_monthly0}: - factor_days: 176.0 - name: monthly -- - I create a new Contract Wage Type. -- - !record {model: hr.contract.wage.type, id: hr_contract_wage_type_monthlygrosswage0}: - factor_type: 1.9 - name: Monthly Gross Wage - period_id: 'hr_contract_wage_type_period_monthly0' - type: gross - - I create a new contract for "Mark Johnson". - !record {model: hr.contract, id: hr_contract_contract0}: - advantages_gross: 0.0 employee_id: 'hr_employee_employee0' - advantages_net: 0.0 date_end: !eval "'%s-05-18' %(datetime.now().year+1)" date_start: !eval "'%s-05-18' %(datetime.now().year)" trial_date_end: !eval "'%s-03-01' %(datetime.now().year)" trial_date_start: !eval "'%s-04-30' %(datetime.now().year)" name: contract1 wage: 1.0 - wage_type_id: hr_contract_wage_type_monthlygrosswage0 type_id: hr_contract_type_emp working_hours: resource.timesheet_group1 From 60cbbccf8ff9f21448860f3043e3c0f0826a9e84 Mon Sep 17 00:00:00 2001 From: mtr Date: Thu, 7 Apr 2011 10:59:46 +0530 Subject: [PATCH 2/3] [ADD] hr_payroll: added new payslip report bzr revid: mtr@mtr-20110407052946-c7nrhw9yx939o1pj --- addons/hr_payroll/hr_payroll_report.xml | 8 + addons/hr_payroll/report/report_payslip.py | 16 +- addons/hr_payroll/report/report_payslip.rml | 345 ++++++++++++++++++++ 3 files changed, 368 insertions(+), 1 deletion(-) create mode 100644 addons/hr_payroll/report/report_payslip.rml diff --git a/addons/hr_payroll/hr_payroll_report.xml b/addons/hr_payroll/hr_payroll_report.xml index 2fae9bcf4c8..67eea27b26c 100644 --- a/addons/hr_payroll/hr_payroll_report.xml +++ b/addons/hr_payroll/hr_payroll_report.xml @@ -9,6 +9,14 @@ rml="hr_payroll/report/payslip.rml" string="Employee PaySlip" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [[repeatIn(objects,'o')]] + + + + Pay Slip + + + + + + + + + + + + + Code + + + [[ o.employee_id.sinid or '' ]] + + + Name + + + [[o.employee_id.name]] + + + + + + + Address + + + [[o.employee_id.address_home_id and o.employee_id.address_home_id.name or '' ]],[[o.employee_id.address_home_id and o.employee_id.address_home_id.street or '' ]],[[o.employee_id.address_home_id and o.employee_id.address_home_id.street2 or '' ]],[[o.employee_id.address_home_id and o.employee_id.address_home_id.zip or '' ]],[[o.employee_id.address_home_id and o.employee_id.address_home_id.city or '' ]],[[o.employee_id.address_home_id and o.employee_id.address_home_id.state_id and o.employee_id.address_home_id.state_id.name or '' ]] [[o.employee_id.address_home_id and o.employee_id.address_home_id.country_id and o.employee_id.address_home_id.country_id.name or '' ]] + + + + + + + Email + + + [[ o.employee_id.work_email or '' ]] + + + Bank Details + + + [[ o.employee_id.otherid or '' ]] + + + + + + + Slip ID + + + [[ o.number or '' ]] + + + Identification No + + + [[ o.employee_id.passport_id and o.employee_id.passport_id.name or '' ]] + + + + + + + Register + + + [[ o.register_id and o.register_id.name or '' ]] + + + Designation + + + [[ o.employee_id.contract_id and o.employee_id.contract_id.job_id.name or '' ]] + + + + + + Payslip Lines + + + + + Sequence + + + Name + + + Code + + + Sub Total + + + + + [[repeatIn(get_payslip_lines(o.line_ids),'p') ]] [[ p.sequence ]] + + + [[ p.name ]] + + + [[ p.code ]] + + + [[ p.total ]] [[ o.company_id and o.company_id.currency_id.symbol or '' ]] + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + +
+ + + + + + + + + + + + + + + + + + Authorized Signature + + + + + + +
+
+ From 8a625c9901f7d46bd30c5ee74de20e69f1994576 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Thu, 7 Apr 2011 12:12:26 +0200 Subject: [PATCH 3/3] [IMP] hr_payroll: removed hr.contibution.register.line object bzr revid: qdp-launchpad@openerp.com-20110407101226-9gworw70i6rvqlp2 --- addons/hr_payroll/hr_payroll.py | 52 +-------------------------------- 1 file changed, 1 insertion(+), 51 deletions(-) diff --git a/addons/hr_payroll/hr_payroll.py b/addons/hr_payroll/hr_payroll.py index 2538b9d539c..2e0caf1488f 100644 --- a/addons/hr_payroll/hr_payroll.py +++ b/addons/hr_payroll/hr_payroll.py @@ -136,7 +136,6 @@ class hr_contract(osv.osv): hr_contract() -#TODO clean this class class contrib_register(osv.osv): ''' Contribution Register @@ -145,29 +144,10 @@ class contrib_register(osv.osv): _name = 'hr.contibution.register' _description = 'Contribution Register' -# def _total_contrib(self, cr, uid, ids, field_names, arg, context=None): -# line_pool = self.pool.get('hr.contibution.register.line') -# -# res = {} -# for cur in self.browse(cr, uid, ids, context=context): -# current = line_pool.search(cr, uid, [('register_id','=',cur.id)], context=context) -# e_month = 0.0 -# c_month = 0.0 -# for i in line_pool.browse(cr, uid, current, context=context): -# e_month += i.emp_deduction -# c_month += i.comp_deduction -# res[cur.id]={ -# 'monthly_total_by_emp':e_month, -# 'monthly_total_by_comp':c_month, -# } -# return res - _columns = { 'company_id':fields.many2one('res.company', 'Company', required=False), 'name':fields.char('Name', size=256, required=True, readonly=False), - 'register_line_ids':fields.one2many('hr.contibution.register.line', 'register_id', 'Register Line', readonly=True), -# 'monthly_total_by_emp': fields.function(_total_contrib, method=True, multi='dc', string='Total By Employee', digits=(16, 4)), -# 'monthly_total_by_comp': fields.function(_total_contrib, method=True, multi='dc', string='Total By Company', digits=(16, 4)), + 'register_line_ids':fields.one2many('hr.payslip.line', 'register_id', 'Register Line', readonly=True), 'note': fields.text('Description'), } _defaults = { @@ -178,36 +158,6 @@ class contrib_register(osv.osv): contrib_register() -#TODO clean this class -class contrib_register_line(osv.osv): - ''' - Contribution Register Line - ''' - - _name = 'hr.contibution.register.line' - _description = 'Contribution Register Line' - - def _total(self, cr, uid, ids, field_names, arg, context=None): - res = {} - for line in self.browse(cr, uid, ids, context=context): - res[line.id] = line.emp_deduction + line.comp_deduction - return res - - _columns = { - 'name':fields.char('Name', size=256, required=True, readonly=False), - 'register_id':fields.many2one('hr.contibution.register', 'Register', required=False), - 'code':fields.char('Code', size=64, required=False, readonly=False), - 'employee_id':fields.many2one('hr.employee', 'Employee', required=True), - 'date': fields.date('Date'), - 'emp_deduction': fields.float('Employee Deduction', digits=(16, 4)), - 'comp_deduction': fields.float('Company Deduction', digits=(16, 4)), - 'total': fields.function(_total, method=True, store=True, string='Total', digits=(16, 4)), - } - _defaults = { - 'date': lambda *a: time.strftime('%Y-%m-%d'), - } -contrib_register_line() - class hr_salary_head(osv.osv): """ HR Salary Head