diff --git a/yuthon_catering/models/yuthon_catering.py b/yuthon_catering/models/yuthon_catering.py index c1764ccd8..3befbed8c 100644 --- a/yuthon_catering/models/yuthon_catering.py +++ b/yuthon_catering/models/yuthon_catering.py @@ -7,6 +7,7 @@ class YuthonCatering(models.Model): _name = 'yuthon.catering' date = fields.Date(string='日期', required=True) + employee_number = fields.Char(string='序号', related='employee_id.user_number', store=True) week_day = fields.Char(string='星期', compute='_compute_week_day', store=True) dept_id = fields.Many2one(string='部门', comodel_name='hr.department', related='employee_id.department_id', store=True) employee_id = fields.Many2one(string='员工', comodel_name='hr.employee', required=True) @@ -447,14 +448,12 @@ class YuthonCatering(models.Model): conf = self.env['yuthon.catering.conf'].search([], limit=1) if not conf or not conf.employee_ids: return - employee_ids = conf.employee_ids target_months = [ (2025, 12), (2026, 1), (2026, 2), ] - all_dates = [] for y, m in target_months: d = date_cls(y, m, 1) diff --git a/yuthon_catering/views/yuthon_catering.xml b/yuthon_catering/views/yuthon_catering.xml index 1bd31618f..95dd0a707 100644 --- a/yuthon_catering/views/yuthon_catering.xml +++ b/yuthon_catering/views/yuthon_catering.xml @@ -6,7 +6,7 @@ yuthon.catering.tree yuthon.catering - +
+ diff --git a/yuthon_holiday/models/inherit_hr_leave.py b/yuthon_holiday/models/inherit_hr_leave.py index 0a3ae32cc..de7a2904f 100644 --- a/yuthon_holiday/models/inherit_hr_leave.py +++ b/yuthon_holiday/models/inherit_hr_leave.py @@ -18,6 +18,7 @@ class HrLeave(models.Model): _inherit = 'hr.leave' number_of_days = fields.Float(string='天数', digits=(16, 3)) + def _check_validity(self): sorted_leaves = defaultdict(lambda: self.env['hr.leave']) for leave in self: diff --git a/yuthon_hr_attendance/models/yuthon_holiday_statement.py b/yuthon_hr_attendance/models/yuthon_holiday_statement.py index 554d70a21..172c212e0 100644 --- a/yuthon_hr_attendance/models/yuthon_holiday_statement.py +++ b/yuthon_hr_attendance/models/yuthon_holiday_statement.py @@ -13,6 +13,7 @@ class InheritHrLeave(models.Model): _description = '请假情况' caption = fields.Char(string="标题", compute="_compute_application_reason") + employee_number = fields.Char(string='序号', related='employee_id.user_number', store=True) employee_id = fields.Many2one('hr.employee', string="发起人") mobile_phone = fields.Char(related='employee_id.mobile_phone', string="手机号") entry_date = fields.Date(related='employee_id.entry_date', string="入职时间", store=True) diff --git a/yuthon_hr_attendance/models/yuthon_meal_line.py b/yuthon_hr_attendance/models/yuthon_meal_line.py index a6d7dfa74..684c3b9f6 100644 --- a/yuthon_hr_attendance/models/yuthon_meal_line.py +++ b/yuthon_hr_attendance/models/yuthon_meal_line.py @@ -10,6 +10,7 @@ class YuthonMealLine(models.Model): _description = '误餐明细' employee_id = fields.Many2one('hr.employee', string="员工") + employee_number = fields.Char(string='序号', related='employee_id.user_number', store=True) meal_name = fields.Char(string='标题') meal_id = fields.Many2one('vacation.meal.line', string="关联误餐额度记录") entry_date = fields.Date(related='employee_id.entry_date', string="入职时间", store=True) diff --git a/yuthon_hr_attendance/models/yuthon_overtime_line.py b/yuthon_hr_attendance/models/yuthon_overtime_line.py index fd0b1643b..08e9bbd5b 100644 --- a/yuthon_hr_attendance/models/yuthon_overtime_line.py +++ b/yuthon_hr_attendance/models/yuthon_overtime_line.py @@ -11,6 +11,7 @@ class YuthonOvertimeLine(models.Model): employee_id = fields.Many2one('hr.employee', string="员工") entry_date = fields.Date(related='employee_id.entry_date', string="入职时间", store=True) + employee_number = fields.Char(string='序号', related='employee_id.user_number', store=True) select_month = fields.Selection([('1', '一月'), ('2', '二月'), ('3', '三月'), ('4', '四月'), ('5', '五月'), ('6', '六月'), ('7', '七月'), ('8', '八月'), ('9', '九月'), ('10', '十月'), ('11', '十一月'), diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index 5b5344181..f8c63b17a 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -21,6 +21,7 @@ class YuthonVacationReports(models.Model): month_id = fields.Many2one('base.month', string='月份', compute="_compute_display_date", store=True) year_id = fields.Many2one('base.year', string='年份', compute="_compute_display_date", store=True) employee_id = fields.Many2one('hr.employee', string='员工') + employee_number = fields.Char(string='序号', related='employee_id.user_number', store=True, readonly=True) entry_date = fields.Date(related='employee_id.entry_date', string="入职时间", store=True) number_card = fields.Integer(string='补卡次数', compute="_compute_number_card") remaining_number_card = fields.Integer(string='剩余补卡次数', default=3, compute="_compute_number_card", store=True) @@ -2510,6 +2511,7 @@ class VacationOverline(models.Model): default=lambda self: str(datetime.now().year)) vacation_id = fields.Many2one('yuthon.vacation.reports', string='关联假期额度记录') employee_id = fields.Many2one('hr.employee', string='员工', compute='_compute_employee_id', store=True) + employee_number = fields.Char(string='序号', related='employee_id.user_number', store=True) entry_date = fields.Date(related='employee_id.entry_date', string="入职时间", store=True) department_id = fields.Many2one('hr.department', related='employee_id.department_id', string="部门") company_id = fields.Many2one('res.company', related='employee_id.company_id', string="公司") @@ -2872,6 +2874,7 @@ class VacationMealLine(models.Model): vacation_id = fields.Many2one('yuthon.vacation.reports', string='关联假期额度记录') is_filing = fields.Boolean(string="归档") + employee_number = fields.Char(string='序号', related='employee_id.user_number', store=True) employee_id = fields.Many2one('hr.employee', string='员工', compute='_compute_employee_id', store=True) entry_date = fields.Date(related='employee_id.entry_date', string="入职时间", store=True) department_id = fields.Many2one('hr.department', related='employee_id.department_id', string="部门", store=True) diff --git a/yuthon_hr_attendance/views/yuthon_holiday_statement.xml b/yuthon_hr_attendance/views/yuthon_holiday_statement.xml index e401d74d3..533140069 100644 --- a/yuthon_hr_attendance/views/yuthon_holiday_statement.xml +++ b/yuthon_hr_attendance/views/yuthon_holiday_statement.xml @@ -4,10 +4,11 @@ hr.leave.statement.tree hr.leave - +
+ diff --git a/yuthon_hr_attendance/views/yuthon_meal_line_views.xml b/yuthon_hr_attendance/views/yuthon_meal_line_views.xml index d183b3be4..17337a04c 100644 --- a/yuthon_hr_attendance/views/yuthon_meal_line_views.xml +++ b/yuthon_hr_attendance/views/yuthon_meal_line_views.xml @@ -4,10 +4,11 @@ yuthon.meal.line.tree yuthon.meal.line - +
+ diff --git a/yuthon_hr_attendance/views/yuthon_overtime_line_views.xml b/yuthon_hr_attendance/views/yuthon_overtime_line_views.xml index c41b76fb0..3a667c8fb 100644 --- a/yuthon_hr_attendance/views/yuthon_overtime_line_views.xml +++ b/yuthon_hr_attendance/views/yuthon_overtime_line_views.xml @@ -27,7 +27,8 @@ yuthon.overtime.line.tree yuthon.overtime.line - + + diff --git a/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml b/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml index 2103f5cf3..a0782eeb3 100644 --- a/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml +++ b/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml @@ -4,7 +4,7 @@ vacation.meal.line.tree vacation.meal.line - +
@@ -44,7 +44,7 @@ yuthon.vacation.reports.tree yuthon.vacation.reports -
+