Merge pull request !483 from 李鹏宇/dev_zhou
This commit is contained in:
李鹏宇
2024-11-18 09:44:25 +00:00
committed by Gitee
4 changed files with 23 additions and 7 deletions
@@ -109,9 +109,6 @@ class HolidaysRequestBatch(models.Model):
'res_model': 'holiday.detail.wizard',
'view_mode': 'form'}
def put_modify_days(self):
pass
@api.onchange('leave_line_ids')
def _onchange_name(self):
if self.leave_line_ids:
@@ -46,4 +46,7 @@ class YuthonDutyArrangement(models.Model):
@api.onchange('duration')
def bottom_auto_schedule(self):
pass
pass
def bottom_adjustment(self):
pass
@@ -17,6 +17,7 @@
<field name="is_photo_two"/>
<field name="is_photo_three"/>
<field name="is_abnormal"/>
<button name="button_clone_task" type="object" string="调休" class="btn btn-primary"/>
</tree>
</field>
</record>
@@ -34,11 +35,11 @@
</div>
<group col="2">
<group>
<field name="start_time"/>
<field name="start_time" required="1"/>
<field name="is_abnormal"/>
</group>
<group>
<field name="end_time"/>
<field name="end_time" required="1"/>
<field name="remind"/>
</group>
</group>
@@ -69,7 +69,7 @@ class YuthonHrEmployee(models.Model):
open_start_time_today = fields.Date(string="工作至今")
interrupt_work_month = fields.Integer(string="中断工作月数")
cumulative_work_month = fields.Integer(string="累计工作月数", compute='_compute_cumulative_work_month', store=True)
cumulative_work_years = fields.Char(string="累计工作年限")
cumulative_work_years = fields.Char(string="累计工作年限", compute='_compute_cumulative_work_years', store=True)
# 教育
high_degree = fields.Char(string="最高学历")
high_degree2 = fields.Char(string="最高学位")
@@ -194,6 +194,21 @@ class YuthonHrEmployee(models.Model):
result_str = f"{months}个月"
record.social_insurance_time = result_str
@api.depends('cumulative_work_month')
def _compute_cumulative_work_years(self):
for record in self:
if record.cumulative_work_month:
if record.cumulative_work_month <= 0:
record.social_insurance_time = "0个月"
years = record.cumulative_work_month // 12
months = record.cumulative_work_month % 12
if years > 0:
result_str = f"{years}年"
if months > 0:
result_str += f"{months}个月"
else:
result_str = f"{months}个月"
record.cumulative_work_years = result_str
@api.depends('identification_id') # 只依赖身份证号码
def _compute_info(self):