-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/yuthon_salary/models/inherit_hr_payroll_structure.py b/yuthon_salary/models/inherit_hr_payroll_structure.py
index 12a731aec..59e023206 100644
--- a/yuthon_salary/models/inherit_hr_payroll_structure.py
+++ b/yuthon_salary/models/inherit_hr_payroll_structure.py
@@ -147,7 +147,6 @@ class HrPayrollStructure(models.Model):
structure.write({'rule_ids': rule_list})
def salary_rule_data(self):
- # 定义不同公司的字段映射
company_mappings = {
'thwg': {
'基本工资': 'base_salary',
diff --git a/yuthon_salary/views/inherit_hr_payroll_structure_views.xml b/yuthon_salary/views/inherit_hr_payroll_structure_views.xml
index 69fca5cb2..e5bb6092f 100644
--- a/yuthon_salary/views/inherit_hr_payroll_structure_views.xml
+++ b/yuthon_salary/views/inherit_hr_payroll_structure_views.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/yuthon_salary/wizard/salary_compute_wizard.py b/yuthon_salary/wizard/salary_compute_wizard.py
index 9aa1efa03..db67ad679 100644
--- a/yuthon_salary/wizard/salary_compute_wizard.py
+++ b/yuthon_salary/wizard/salary_compute_wizard.py
@@ -13,7 +13,7 @@ class SalaryComputeWizard(models.Model):
_description = '薪资计算弹窗'
department_ids = fields.Many2many('hr.department', string="部门")
- personnel_ids = fields.Many2many('hr.employee', string='人员', store=True)
+ employee_ids = fields.Many2many('hr.employee', string='人员', store=True)
select_year = fields.Selection(selection=[(str(i), str(i)) for i in range(2024, 2060)], string='年份',
default=lambda self: str(datetime.now().year))
select_time = fields.Selection([('1', '一月'), ('2', '二月'), ('3', '三月'), ('4', '四月'),
@@ -39,7 +39,18 @@ class SalaryComputeWizard(models.Model):
department_user_ids = set()
for department_id in self.department_ids:
department_user_ids.update(get_department_employees(department_id))
- self.personnel_ids = [(6, 0, list(department_user_ids))]
+ self.employee_ids = [(6, 0, list(department_user_ids))]
+
def confirm(self):
- pass
\ No newline at end of file
+ for employee in self.employee_ids:
+ contract_id = self.env['hr.contract'].search([('employee_id', '=', employee.id)], limit=1)
+ struct_id = contract_id.structure_type_id.default_struct_id
+ payslip = self.env['hr.payslip'].create({
+ 'name': employee.name,
+ 'employee_id': employee.id,
+ 'contract_id': contract_id.id,
+ 'struct_id': struct_id.id,
+ 'state':'draft',
+ })
+ payslip.compute_sheet()
diff --git a/yuthon_salary/wizard/salary_compute_wizard_views.xml b/yuthon_salary/wizard/salary_compute_wizard_views.xml
index d310c999d..e21d9a09d 100644
--- a/yuthon_salary/wizard/salary_compute_wizard_views.xml
+++ b/yuthon_salary/wizard/salary_compute_wizard_views.xml
@@ -8,7 +8,7 @@
-
+