From 37ed0b23c87484b95a9945079bb1b644d641375a Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Sat, 18 Jan 2025 16:37:09 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_holiday/data/yuthon_holiday_data.xml | 6 ++ .../models/inherit_hr_leave_allocation.py | 13 ++-- .../models/yuthon_fixes_approval.py | 2 +- yuthon_holiday/views/hr_leave_batch.xml | 6 +- .../inherit_hr_leave_allocation_views.xml | 2 +- yuthon_trade/__manifest__.py | 4 +- yuthon_trade/data/sale_renting_code_data.xml | 6 ++ yuthon_trade/models/__init__.py | 4 +- .../models/yuthon_care_condolences.py | 23 +++++++ yuthon_trade/models/yuthon_trade_setting.py | 15 +++++ .../models/yuthon_work_condolences.py | 12 +++- yuthon_trade/security/ir.model.access.csv | 4 ++ .../views/yuthon_care_condolences_views.xml | 64 +++++++++++++++++++ yuthon_trade/views/yuthon_trade_menu.xml | 19 ++++++ .../views/yuthon_trade_setting_views.xml | 31 +++++++++ .../views/yuthon_work_condolences.xml | 34 ---------- .../views/yuthon_work_condolences_views.xml | 51 +++++++++++++++ 17 files changed, 247 insertions(+), 49 deletions(-) create mode 100644 yuthon_trade/models/yuthon_care_condolences.py create mode 100644 yuthon_trade/models/yuthon_trade_setting.py create mode 100644 yuthon_trade/views/yuthon_care_condolences_views.xml create mode 100644 yuthon_trade/views/yuthon_trade_setting_views.xml delete mode 100644 yuthon_trade/views/yuthon_work_condolences.xml create mode 100644 yuthon_trade/views/yuthon_work_condolences_views.xml diff --git a/yuthon_holiday/data/yuthon_holiday_data.xml b/yuthon_holiday/data/yuthon_holiday_data.xml index 2f4c53bf1..b3088c82c 100644 --- a/yuthon_holiday/data/yuthon_holiday_data.xml +++ b/yuthon_holiday/data/yuthon_holiday_data.xml @@ -7,4 +7,10 @@ 4 + + 修正编号 + yuthon_holiday_fixes_code + XZ + 4 + \ No newline at end of file diff --git a/yuthon_holiday/models/inherit_hr_leave_allocation.py b/yuthon_holiday/models/inherit_hr_leave_allocation.py index e877017d6..7bf715594 100644 --- a/yuthon_holiday/models/inherit_hr_leave_allocation.py +++ b/yuthon_holiday/models/inherit_hr_leave_allocation.py @@ -81,7 +81,8 @@ class HrLeaveAllocation(models.Model): self.env['hr.leave.allocation'].with_context(mail_notify_force_send=False, mail_activity_automation_skip=True).create(allocation_vals) self.linked_request_ids.filtered(lambda c: c.state != 'validate').action_validate() - def button_fixes_wizard(self): + def button_fixes_approval(self): + form_id = self.env.ref('yuthon_holiday.view_yuthon_fixes_approval_form').id if self.type_request_unit == 'hour': now_type = 'hours' else: @@ -89,15 +90,15 @@ class HrLeaveAllocation(models.Model): return { "type": "ir.actions.act_window", "name": "修正申请", - "res_model": "yuthon.fixes.wizard", - "view_mode": 'form', - 'target': 'new', + "res_model": "yuthon.fixes.approval", + "views": [[form_id, "form"]], "context": { 'default_users_id': self.employee_id.user_id.id, 'default_leave_id': self.id, 'default_now_type': now_type, - } + 'default_original_days': self.number_of_days_display if self.type_request_unit == 'days' else 0, + 'default_original_hours': self.number_of_days_display if self.type_request_unit == 'hours' else 0, + } } - diff --git a/yuthon_holiday/models/yuthon_fixes_approval.py b/yuthon_holiday/models/yuthon_fixes_approval.py index cc32f4356..d6d402403 100644 --- a/yuthon_holiday/models/yuthon_fixes_approval.py +++ b/yuthon_holiday/models/yuthon_fixes_approval.py @@ -9,7 +9,7 @@ class YuthonFixesApproval(models.Model): yuthon_company = fields.Selection(related='users_id.employee_id.yuthon_company', string="公司") name = fields.Char(string="标题") - code = fields.Char(string="编号") + code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_holiday_fixes_code')) users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id) original_days = fields.Float(string="原休假时长(天)") original_hours = fields.Float(string="原休假时长(小时)") diff --git a/yuthon_holiday/views/hr_leave_batch.xml b/yuthon_holiday/views/hr_leave_batch.xml index 73629ee3b..09896c553 100644 --- a/yuthon_holiday/views/hr_leave_batch.xml +++ b/yuthon_holiday/views/hr_leave_batch.xml @@ -38,6 +38,9 @@ + + + - - - diff --git a/yuthon_holiday/views/inherit_hr_leave_allocation_views.xml b/yuthon_holiday/views/inherit_hr_leave_allocation_views.xml index 8dac334be..0daba141f 100644 --- a/yuthon_holiday/views/inherit_hr_leave_allocation_views.xml +++ b/yuthon_holiday/views/inherit_hr_leave_allocation_views.xml @@ -18,7 +18,7 @@ 结束时间 -