From 093e8973f31ffc94ad1f5c129aa1a4aa459e973f Mon Sep 17 00:00:00 2001 From: sonal arora Date: Sun, 20 Sep 2020 14:23:30 +0530 Subject: [PATCH] work on payroll --- hr_payroll_community/models/hr_payslip.py | 18 ++++++++++++++++++ .../views/hr_payslip_views.xml | 16 ++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/hr_payroll_community/models/hr_payslip.py b/hr_payroll_community/models/hr_payslip.py index 6852ab0..e2a5ee0 100644 --- a/hr_payroll_community/models/hr_payslip.py +++ b/hr_payroll_community/models/hr_payslip.py @@ -62,6 +62,8 @@ class HrPayslip(models.Model): states={'draft': [('readonly', False)]}) input_line_ids = fields.One2many('hr.payslip.input', 'payslip_id', string='Payslip Inputs', readonly=True, states={'draft': [('readonly', False)]}) + emp_salary_line_ids = fields.One2many('employee.salary.rule', 'emloyee_payslip_id', string='Salary rule', + readonly=True) paid = fields.Boolean(string='Made Payment Order ? ', readonly=True, copy=False, states={'draft': [('readonly', False)]}) note = fields.Text(string='Internal Note', readonly=True, states={'draft': [('readonly', False)]}) @@ -648,3 +650,19 @@ class ResourceMixin(models.AbstractModel): 'days': days, 'hours': sum(day_hours.values()), } + +class EmployeeSalary(models.Model): + _name = 'employee.salary.rule' + _description = 'Employee Payslip Salary Rule' + + employee_id = fields.Many2one('hr.employee', string='Employee', required=True, readonly=True, + help="Employee") + emloyee_payslip_id = fields.Many2one('hr.payslip', string='Pay Slip',index=True, help="Payslip") + basic_salary = fields.Float() + other_allowance = fields.Float() + housing_allowance = fields.Float('Housing Allowance') + travel_allowance = fields.Float('Transportation Allowance') + total_salary = fields.Float('Total Salary') + monthly_deduct = fields.Float('Monthly Deduction in AED') + deduction_start_date = fields.date('Deduction Start Date') + deduction_end_date = fields.date('Deduction End Date') diff --git a/hr_payroll_community/views/hr_payslip_views.xml b/hr_payroll_community/views/hr_payslip_views.xml index 8f20bc2..ef45abd 100644 --- a/hr_payroll_community/views/hr_payslip_views.xml +++ b/hr_payroll_community/views/hr_payslip_views.xml @@ -252,6 +252,22 @@ + + + + + + + + + + + + + + + +