diff --git a/yuthon_hr_employee/models/inherit_hr_job.py b/yuthon_hr_employee/models/inherit_hr_job.py index c24ca3e05..13eacf5e4 100644 --- a/yuthon_hr_employee/models/inherit_hr_job.py +++ b/yuthon_hr_employee/models/inherit_hr_job.py @@ -104,6 +104,15 @@ class HrJob(models.Model): if department_id: job.sudo().write({'department_id': department_id.id if len(department_id) == 1 else department_id[0].id}) + def f6_new(self): + job_ids = self.env["hr.job"].browse(self._context.get('active_ids', self._context.get('active_id'))) + for job in job_ids: + if job.department_id: + company_id = job.department_id.company_id + if company_id: + job.sudo().write( + {'company_id': company_id}) + def write(self, vals): res = super(HrJob, self).write(vals) if 'job_personnel_ids' in vals: diff --git a/yuthon_hr_employee/security/company_rule.xml b/yuthon_hr_employee/security/company_rule.xml index be7d1db73..07e46bd14 100644 --- a/yuthon_hr_employee/security/company_rule.xml +++ b/yuthon_hr_employee/security/company_rule.xml @@ -5,6 +5,11 @@ [('company_id', 'in', company_ids)] + + 岗位多公司 + + [('company_id', 'in', company_ids)] + 工资单分组多公司 diff --git a/yuthon_hr_employee/views/inherit_hr_job_views.xml b/yuthon_hr_employee/views/inherit_hr_job_views.xml index a3a5949f5..e10f52f85 100644 --- a/yuthon_hr_employee/views/inherit_hr_job_views.xml +++ b/yuthon_hr_employee/views/inherit_hr_job_views.xml @@ -7,7 +7,13 @@ code action = model.f5_new() - + + 同步公司 + + + code + action = model.f6_new() + hr.job.inherit hr.job diff --git a/yuthon_salary/models/inherit_hr_payslip.py b/yuthon_salary/models/inherit_hr_payslip.py index f3c80eb6a..c871f9be9 100644 --- a/yuthon_salary/models/inherit_hr_payslip.py +++ b/yuthon_salary/models/inherit_hr_payslip.py @@ -9,6 +9,8 @@ class InheritHrPayslip(models.Model): employee_id = fields.Many2one('hr.employee', string="姓名") base_salary = fields.Float(string='基本工资', compute='_compute_salary', store=True) bank_account = fields.Char(string='银行账号', related='employee_id.bank_account', store=True) + tax_payable = fields.Float(string='应补(退)税额', store=True) + actual_salary = fields.Float(string='实发工资', store=True, compute='_compute_actual_salary') identification_id = fields.Char(string='证件号码', related='employee_id.identification_id', store=True) card_type = fields.Char(string='证件类型', store=True, default="居民身份证") salary_group_id = fields.Many2one('yuthon.salary.group', string="工资组", store=True, index=True) @@ -75,6 +77,7 @@ class InheritHrPayslip(models.Model): performance_deduction = fields.Float(string='扣发绩效奖金', compute='_compute_deduction', store=True) commuting_deduction = fields.Float(string='扣发通信补贴', compute='_compute_deduction', store=True) base_salary_deduction = fields.Float(string='扣发基本工资', compute='_compute_deduction', store=True) + specialized_deduction = fields.Float(string='累计专项扣除') def action_refresh_from_work_entries(self): if any(p.state not in ['draft', 'verify'] for p in self): @@ -219,6 +222,25 @@ class InheritHrPayslip(models.Model): record.base_salary_deduction ) + @api.depends('total_before_tax', 'basic_endowment_insurance', 'basic_medical_insurance', + 'unemployment_insurance', 'housing_provident_fund', 'b_year', 'tax_payable', + 'union_dues', 'meal_misunderstanding_fee', 'temporary_performance_bonus', + 'reimburse_performance_bonus', 'life_salary') + def _compute_actual_salary(self): + for record in self: + record.actual_salary = (record.total_before_tax - + record.basic_endowment_insurance - + record.basic_medical_insurance - + record.unemployment_insurance - + record.housing_provident_fund - + record.b_year - + record.tax_payable - + record.union_dues - + record.meal_misunderstanding_fee - + record.temporary_performance_bonus - + record.reimburse_performance_bonus - + record.life_salary) + def put_button(self): for record in self: record.write({'is_push': True}) diff --git a/yuthon_salary/static/others/hr_payslip_template.xlsx b/yuthon_salary/static/others/hr_payslip_template.xlsx index fdf12f768..8fae842e7 100644 Binary files a/yuthon_salary/static/others/hr_payslip_template.xlsx and b/yuthon_salary/static/others/hr_payslip_template.xlsx differ diff --git a/yuthon_salary/views/inherit_hr_payroll_structure_views.xml b/yuthon_salary/views/inherit_hr_payroll_structure_views.xml index f3c399559..9e5242104 100644 --- a/yuthon_salary/views/inherit_hr_payroll_structure_views.xml +++ b/yuthon_salary/views/inherit_hr_payroll_structure_views.xml @@ -92,7 +92,7 @@ 职级 hr.payroll.structure tree,form,search - {'group_by_no_leaf':1,'group_by':[]} + 批量更新职级类型 diff --git a/yuthon_salary/views/inherit_hr_payslip_views.xml b/yuthon_salary/views/inherit_hr_payslip_views.xml index 3ab3fe670..fdc77993a 100644 --- a/yuthon_salary/views/inherit_hr_payslip_views.xml +++ b/yuthon_salary/views/inherit_hr_payslip_views.xml @@ -24,36 +24,46 @@ 1 + + hide + - + + + - - - - - - - + - - + + + + + + + + + + + - - - - - - - + + + + + + + + + @@ -162,7 +172,7 @@ - + @@ -202,6 +212,7 @@ + @@ -262,22 +273,15 @@ - - inherit.view.hr.payslip.tree - hr.payslip - - - - - - - 薪资审定 hr.payslip tree,form,search [('is_salary_push', '=', True)] {'search_default_group_by_employee': 1} + 薪资计算 diff --git a/yuthon_salary/wizard/salary_payslip_wizard.py b/yuthon_salary/wizard/salary_payslip_wizard.py index d18bf2728..432b7ef00 100644 --- a/yuthon_salary/wizard/salary_payslip_wizard.py +++ b/yuthon_salary/wizard/salary_payslip_wizard.py @@ -10,6 +10,7 @@ from datetime import datetime class SalaryPayslipWizard(models.Model): _name = 'salary.payslip.wizard' + _description = '个税计算导入' excel_file = fields.Binary(string="上传Excel表") excel_name = fields.Char(string="文件名")