添加功能

This commit is contained in:
zhou
2025-06-14 20:31:49 +08:00
parent 3128aaa84e
commit 2fa406afa2
3 changed files with 9 additions and 8 deletions
@@ -42,12 +42,13 @@ class HrContract(models.Model):
@api.onchange('date_end')
def _onchange_date_end(self):
today = date.today()
if self.date_end < today:
self.state = 'close'
elif self.date_end == today:
self.state = 'close'
else:
self.state = 'open'
if self.date_end:
if self.date_end < today:
self.state = 'close'
elif self.date_end == today:
self.state = 'close'
else:
self.state = 'open'
@api.depends_context('uid', 'company')
@api.depends('company_id')
@@ -153,7 +153,7 @@
<group string="工资计算" col="2">
<group>
<field name="salary_group_id" options="{'no_create': True}"/>
<field name="salary_year"/>
<field name="salary_year" invisible="1"/>
<field name="last_year_salary"/>
<field name="social_base_on"/>
<field name="social_base_off"/>
@@ -76,7 +76,7 @@ class YuthonPayrollCommon(models.Model):
if ins.name == '安全生产管理补贴':
formula_salary = "result = 320 if employee.department_id.name != '领导班子' else 0"
if ins.name == '工龄补贴':
formula_salary = "result = min(400, ((employee.entry_date - employee.open_start_time).days // 30.4375 - employee.interrupt_work_month) // 12) * 10 + employee.salary_year * 20 if employee.department_id.name != '领导班子' else 0"
formula_salary = formula_salary = "result = min(400, max(0, ((employee.entry_date - employee.open_start_time).days // 30.4375 - employee.interrupt_work_month) // 12) * 10 + employee.salary_year * 20) if employee.department_id.name != '领导班子' else 0"
if ins.name == '岗位绩效':
formula_salary = "result = 0"
if ins.name == '高温补贴':