diff --git a/yuthon_holiday/models/inherit_hr_leave.py b/yuthon_holiday/models/inherit_hr_leave.py
index cb2c3c3e0..3686339dc 100644
--- a/yuthon_holiday/models/inherit_hr_leave.py
+++ b/yuthon_holiday/models/inherit_hr_leave.py
@@ -726,7 +726,7 @@ class HolidaysRequestBatch(models.Model):
@api.depends('users_id')
def _compute_holiday_allowance(self):
current_date = fields.Date.today()
- vacation_date = current_date - relativedelta(months=1)
+ vacation_date = current_date
for record in self:
reports_id = self.env['yuthon.vacation.reports'].search([('employee_id', '=', record.users_id.employee_ids.id),
('vacation_date', '=', vacation_date.replace(day=1))
diff --git a/yuthon_salary/models/inherit_hr_payroll_structure.py b/yuthon_salary/models/inherit_hr_payroll_structure.py
index db07355ca..d066551cc 100644
--- a/yuthon_salary/models/inherit_hr_payroll_structure.py
+++ b/yuthon_salary/models/inherit_hr_payroll_structure.py
@@ -173,16 +173,15 @@ class HrPayrollStructure(models.Model):
def salary_rule_data(self):
# 定义不同公司的字段映射
company_mappings = {
- '天河物管': { # 天河物管
+ # '天河物管': {
+ # '基本工资': 'base_salary',
+ # '岗位工资': 'position_salary',
+ # '综合补贴': 'integrated_subsidy',
+ # '通讯补贴': 'communication_subsidy'
+ # },
+ '天河粮储': {
'基本工资': 'base_salary',
- '岗位工资': 'position_salary',
- '综合补贴': 'integrated_subsidy',
- '通讯补贴': 'communication_subsidy'
- },
- '天河粮储': { # 天河梁储
- '基本工资': 'base_salary',
- '岗位工资': 'position_salary',
- '岗位补贴': 'position_subsidy',
+ '职级工资': 'rank_salary',
'预发绩效奖金': 'advance_performance_bonuses'
}
}
diff --git a/yuthon_salary/views/inherit_hr_payroll_structure_views.xml b/yuthon_salary/views/inherit_hr_payroll_structure_views.xml
index f0cb8613f..71eaa0912 100644
--- a/yuthon_salary/views/inherit_hr_payroll_structure_views.xml
+++ b/yuthon_salary/views/inherit_hr_payroll_structure_views.xml
@@ -21,7 +21,7 @@
-
+
@@ -46,6 +46,7 @@
hr.payroll.structure
+
@@ -133,6 +134,7 @@
tree,form,search
[('is_enable', '=', True)]
{'search_default_is_enable':1}
+
历史职级
@@ -205,7 +207,7 @@
code
action = model.onetime()
-
+
批量导入职级
diff --git a/yuthon_salary/wizard/yuthon_salary_wizard.py b/yuthon_salary/wizard/yuthon_salary_wizard.py
index ebff2491a..13c8cf6bc 100644
--- a/yuthon_salary/wizard/yuthon_salary_wizard.py
+++ b/yuthon_salary/wizard/yuthon_salary_wizard.py
@@ -22,27 +22,31 @@ class YuthonSalaryWizard(models.Model):
raise ValidationError('请上传文件。')
book = xlrd.open_workbook(file_contents=base64.decodebytes(self.excel_file))
sh = book.sheet_by_index(0)
- salary_dates_tz = []
- salary_dates_lc = []
- salary_dates_wg = []
- for rx in range(0, sh.nrows):
+ for rx in range(1, sh.nrows):
row = sh.row(rx)
- if rx == 0 and sh.name == '天河投资':
- for r in row[3:9]:
- salary_dates_tz.append(r)
- elif rx == 0 and sh.name == '天河物管':
- for r in row[3:15]:
- salary_dates_wg.append(r)
- elif rx == 0 and sh.name == '天河粮储':
- for r in row[3:10]:
- salary_dates_lc.append(r)
- else:
- if sh.name == '天河投资':
- self.salary_tz_data(row,salary_dates_tz)
- elif sh.name == '天河粮储':
- self.salary_lc_data(row, salary_dates_lc)
- elif sh.name == '天河物管':
- self.salary_wg_data(row, salary_dates_wg)
+ self.salary_lc_data(row)
+ # sh = book.sheet_by_index(0)
+ # salary_dates_tz = []
+ # salary_dates_lc = []
+ # salary_dates_wg = []
+ # for rx in range(0, sh.nrows):
+ # row = sh.row(rx)
+ # if rx == 0 and sh.name == '天河投资':
+ # for r in row[3:9]:
+ # salary_dates_tz.append(r)
+ # elif rx == 0 and sh.name == '天河物管':
+ # for r in row[3:15]:
+ # salary_dates_wg.append(r)
+ # elif rx == 0 and sh.name == '天河粮储':
+ # for r in row[3:10]:
+ # salary_dates_lc.append(r)
+ # else:
+ # if sh.name == '天河投资':
+ # self.salary_tz_data(row,salary_dates_tz)
+ # elif sh.name == '天河粮储':
+ # self.salary_lc_data(row, salary_dates_lc)
+ # elif sh.name == '天河物管':
+ # self.salary_wg_data(row, salary_dates_wg)
return {
'name': '批量更新工资项',
@@ -114,7 +118,7 @@ class YuthonSalaryWizard(models.Model):
# }
# salary_name.create(salary_date)
- def salary_lc_data(self, row, rx):
+ def salary_lc_data(self, row):
text = row[0].value
company_id = self.env['res.company'].search([('name', '=', '天河粮储')], limit=1)
level_id = self.env['yuthon.payroll.type.setting'].search([('name', '=', row[4].value),
@@ -122,24 +126,25 @@ class YuthonSalaryWizard(models.Model):
])
if not level_id:
level_id = self.env['yuthon.payroll.type.setting'].create({
- 'sequence': rx,
+ 'sequence': row[5].value,
'name': row[4].value,
'company_id': company_id.id,
})
struct_id = self.env['hr.payroll.structure.type'].search([
('name', '=', text),
+ ('company_id', '=', company_id.id)
])
if not struct_id:
struct_id = self.env['hr.payroll.structure.type'].create({
'name': text,
- 'sequence': rx})
+ 'sequence': row[5].value})
self.env['hr.payroll.structure'].create({
'name': text,
'type_id': struct_id.id,
'level_id': level_id.id,
'company_id': company_id.id,
'create_time': datetime(2025, 11, 1).date(),
- 'sequence': rx, })
+ 'sequence': row[5].value, })
def salary_wg_data(self, row, salary_dates):
salary_name = self.env['hr.salary.rule']