添加功能

This commit is contained in:
李鹏宇
2026-06-30 17:18:41 +08:00
parent 21ab3c73a3
commit cf5c75da7b
@@ -101,8 +101,8 @@ class YuthonHrEmployee(models.Model):
regularization_year = fields.Integer(string="转正(年)", compute='_compute_regularization_year')
open_start_time = fields.Date(string="参加工作时间")
is_membership = fields.Boolean(string="工会会员")
cumulative_work_month = fields.Integer(string="累计工作月数", compute='_compute_social_insurance_info', store=True)
cumulative_work_years = fields.Char(string="累计工作年限", compute='_compute_cumulative_work_years', store=True)
cumulative_work_month = fields.Integer(string="累计工作月数", compute='_compute_social_insurance_info')
cumulative_work_years = fields.Char(string="累计工作年限", compute='_compute_cumulative_work_years')
interrupt_work_month = fields.Integer(string="中断工作月数")
compute_char = fields.Char(string="工龄", compute='_compute_social_insurance_info')
compute_month = fields.Integer(string="工龄(月)")
@@ -968,7 +968,6 @@ class YuthonHrEmployee(models.Model):
f"{years}年" if years > 0 else f"{months}个月")
record.social_insurance_time = social_insurance_time_str
record.compute_char = social_insurance_time_str
record._compute_cumulative_work_years()
@api.depends('cumulative_work_month')
def _compute_cumulative_work_years(self):