From 1882db9bed7407e978fac2cfaf11ca6a3712c780 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Tue, 5 Aug 2025 10:06:37 +0800 Subject: [PATCH] =?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_contract/models/inherit_hr_contract.py | 8 ++++---- .../views/inherit_hr_contract_views.xml | 2 +- .../models/planning_template_inherit.py | 8 ++++---- .../models/yuthon_shift_approval.py | 4 ++-- .../views/yuthon_shift_approval_views.xml | 16 ++++++++++++---- .../models/property_lease_contract.py | 4 ++-- .../views/property_lease_contract.xml | 10 ++++------ .../wizard/property_reconciliation_wizard.py | 3 ++- 8 files changed, 31 insertions(+), 24 deletions(-) diff --git a/yuthon_contract/models/inherit_hr_contract.py b/yuthon_contract/models/inherit_hr_contract.py index 05477d656..1e9f4877f 100644 --- a/yuthon_contract/models/inherit_hr_contract.py +++ b/yuthon_contract/models/inherit_hr_contract.py @@ -72,15 +72,15 @@ class HrContract(models.Model): } } - def pub_retired_employee(self): + def pub_leaving_employee(self): record_id = self.env["hr.contract"].browse(self._context.get('active_ids', self._context.get('active_id'))) if len(record_id) != 1: raise UserError("请选择一个合同") - form_id = self.env.ref('yuthon_hr_employee_approval.view_retired_approval_form').id + form_id = self.env.ref('yuthon_hr_employee_approval.view_yuthon_leaving_approval_form').id return { "type": "ir.actions.act_window", - "name": "退休申请", - "res_model": "yuthon.retired.approval", + "name": "离职申请", + "res_model": "yuthon.leaving.approval", "views": [[form_id, "form"]], "context": { 'default_employee_id': self.employee_id.id, diff --git a/yuthon_contract/views/inherit_hr_contract_views.xml b/yuthon_contract/views/inherit_hr_contract_views.xml index 2358dcbd1..81994c96a 100644 --- a/yuthon_contract/views/inherit_hr_contract_views.xml +++ b/yuthon_contract/views/inherit_hr_contract_views.xml @@ -8,7 +8,7 @@
diff --git a/yuthon_hr_attendance/models/planning_template_inherit.py b/yuthon_hr_attendance/models/planning_template_inherit.py index f86f208a6..5d2ac9ba6 100644 --- a/yuthon_hr_attendance/models/planning_template_inherit.py +++ b/yuthon_hr_attendance/models/planning_template_inherit.py @@ -116,10 +116,10 @@ class Planning(models.Model): for slot in self: planning_name = slot.template_id.planning_name if slot.template_id and slot.template_id.planning_name else "" new_start_datetime = slot.start_datetime + timedelta(hours=8) - start_time_str = new_start_datetime.strftime("%Y-%m-%d %H:%M:%S") - new_end_datetime = slot.end_datetime + timedelta(hours=8) - end_time_str = new_end_datetime.strftime("%H:%M:%S") - slot.display_name = f"{planning_name + '/' + start_time_str + '/' + end_time_str}" + start_time_str = new_start_datetime.strftime("%Y-%m-%d") + # new_end_datetime = slot.end_datetime + timedelta(hours=8) + # end_time_str = new_end_datetime.strftime("%H:%M:%S") + slot.display_name = f"{planning_name + '/' + start_time_str}" @api.depends('template_id.color') def _compute_color(self): diff --git a/yuthon_hr_attendance/models/yuthon_shift_approval.py b/yuthon_hr_attendance/models/yuthon_shift_approval.py index 40390aa66..d840608b1 100644 --- a/yuthon_hr_attendance/models/yuthon_shift_approval.py +++ b/yuthon_hr_attendance/models/yuthon_shift_approval.py @@ -121,7 +121,7 @@ class YuthonShiftContext(models.Model): _description = 'Shift Context' _order = 'start_datetime desc' - start_datetime = fields.Datetime(string='Start Datetime') - end_datetime = fields.Datetime(string='End Datetime') + start_datetime = fields.Datetime(string='开始日期') + end_datetime = fields.Datetime(string='结束日期') planning_name = fields.Char(string='Planning Name') diff --git a/yuthon_hr_attendance/views/yuthon_shift_approval_views.xml b/yuthon_hr_attendance/views/yuthon_shift_approval_views.xml index 864579e5b..b2f8a0a84 100644 --- a/yuthon_hr_attendance/views/yuthon_shift_approval_views.xml +++ b/yuthon_hr_attendance/views/yuthon_shift_approval_views.xml @@ -67,15 +67,23 @@ + 'search_view_ref': 'yuthon_hr_attendance.search_yuthon_shift_context', + 'order': 'start_datetime asc', + 'search_default_group_by_month': True,}"/> + 'search_view_ref': 'yuthon_hr_attendance.search_yuthon_shift_context', + 'order': 'start_datetime asc', + 'search_default_group_by_month': True,}"/> + 'search_view_ref': 'yuthon_hr_attendance.search_yuthon_shift_context', + 'order': 'start_datetime asc', + 'search_default_group_by_month': True,}"/> + 'search_view_ref': 'yuthon_hr_attendance.search_yuthon_shift_context', + 'order': 'start_datetime asc', + 'search_default_group_by_month': True,}"/> diff --git a/yuthon_property_approval/models/property_lease_contract.py b/yuthon_property_approval/models/property_lease_contract.py index f530ee2b9..b0e23bd3a 100644 --- a/yuthon_property_approval/models/property_lease_contract.py +++ b/yuthon_property_approval/models/property_lease_contract.py @@ -119,7 +119,6 @@ class PropertyLeaseContract(models.Model): breach = fields.Integer(string="违约计算时点", default=1) is_split = fields.Boolean(string="是否合同拆分") - split_context = fields.Char(string="拆分内容", default="该合同已拆分") def _get_percentage_liquidated_damages(self): default_rate = self.env['yuthon.penalty.setting'].search( @@ -1193,6 +1192,7 @@ class PropertyLeaseContract(models.Model): raise UserError("只能选择一个拆分") record.is_contract = True record.is_child_contract = False + record.is_split = True record.number += 1 contract_id = self.env['property.lease.contract'].create({ 'name': record.name, @@ -1210,7 +1210,7 @@ class PropertyLeaseContract(models.Model): 'lessor_id':record.lessor_id.id, 'rental_purposes': record.rental_purposes.id, 'address_for_delivery': record.address_for_delivery, - 'lease_term': record.lease_term, + # 'lease_term': record.lease_term, 'lease_term_year': record.lease_term_year, 'lease_term_month': record.lease_term_month, 'term_end_time': record.term_end_time, diff --git a/yuthon_property_approval/views/property_lease_contract.xml b/yuthon_property_approval/views/property_lease_contract.xml index 08d40e874..f5f1cb64f 100644 --- a/yuthon_property_approval/views/property_lease_contract.xml +++ b/yuthon_property_approval/views/property_lease_contract.xml @@ -41,9 +41,7 @@ - -
@@ -67,6 +65,7 @@ + @@ -79,7 +78,7 @@ - + @@ -426,9 +425,7 @@ - -
@@ -452,6 +449,7 @@ + @@ -460,7 +458,7 @@ - + diff --git a/yuthon_property_approval/wizard/property_reconciliation_wizard.py b/yuthon_property_approval/wizard/property_reconciliation_wizard.py index 38cb7ab35..42de98f40 100644 --- a/yuthon_property_approval/wizard/property_reconciliation_wizard.py +++ b/yuthon_property_approval/wizard/property_reconciliation_wizard.py @@ -118,7 +118,8 @@ class PropertyReconciliationWizard(models.Model): first_line = bank_lines[0] for line in rec.reconciliation_line_ids: # 跳过金额为0的行 - if line.amount == 0 and line.collection_type != 'penalty': + if (line.amount == 0 and line.collection_type != 'penalty') or \ + (line.contract_id and line.contract_id.is_split): continue if line.amount != line.rent: if not line.remake: