From 396d0406a62cc10fd18df36bcb367464adf1a857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= <9664676+pengyuthon@user.noreply.gitee.com> Date: Fri, 17 Oct 2025 16:47:34 +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 --- .../wizard/property_rental_wizard.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/yuthon_property_approval/wizard/property_rental_wizard.py b/yuthon_property_approval/wizard/property_rental_wizard.py index 110efa66b..ad164cade 100644 --- a/yuthon_property_approval/wizard/property_rental_wizard.py +++ b/yuthon_property_approval/wizard/property_rental_wizard.py @@ -38,9 +38,14 @@ class PropertyRentalWizard(models.Model): if existing_receivable: return - else: - acc_type = 'new' + receivable = self.env['property.accounts.receivable'].create({ + ('contract_id', '=', record.id), + }) + if receivable: + acc_type = 'new' + else: + acc_type = None if not rent_id: self.sudo().env["property.rent.list"].create({ "contract_id": record.id, From 5bc070cdc34ef9078aaa7e7cc1f97eebdf7d9e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= <9664676+pengyuthon@user.noreply.gitee.com> Date: Fri, 17 Oct 2025 16:52:35 +0800 Subject: [PATCH 2/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_hr_attendance/models/yuthon_shift_approval.py | 4 ++-- yuthon_property_approval/wizard/property_rental_wizard.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/yuthon_hr_attendance/models/yuthon_shift_approval.py b/yuthon_hr_attendance/models/yuthon_shift_approval.py index 734bf16a7..fee8a2e52 100644 --- a/yuthon_hr_attendance/models/yuthon_shift_approval.py +++ b/yuthon_hr_attendance/models/yuthon_shift_approval.py @@ -16,8 +16,8 @@ class YuthonShiftApproval(models.Model): transferees_id = fields.Many2one('resource.resource', string="调班对象", domain="[('id', 'in', resource_ids)]") alternate_id = fields.Many2one('resource.resource', string="替班对象", domain="[('id', 'in', resource_ids)]") alternate_shifts = fields.Selection([('transferees', '调班'), ('alternate', '替班')], string="调替班" , default='transferees') - shift_start = fields.Datetime(string="开始时间") - shift_end = fields.Datetime(string="结束时间") + shift_start = fields.Datetime(string="开始日期") + shift_end = fields.Datetime(string="结束日期") shift_id = fields.Many2one('planning.slot', string="申请人1") shift_two_start = fields.Datetime(string="开始时间") shift_two_end = fields.Datetime(string="结束时间") diff --git a/yuthon_property_approval/wizard/property_rental_wizard.py b/yuthon_property_approval/wizard/property_rental_wizard.py index ad164cade..22766eda5 100644 --- a/yuthon_property_approval/wizard/property_rental_wizard.py +++ b/yuthon_property_approval/wizard/property_rental_wizard.py @@ -36,7 +36,7 @@ class PropertyRentalWizard(models.Model): ('contract_id', '=', record.id), ], limit=1) - if existing_receivable: + if existing_receivable and record.actual_end_time <= start_date: return receivable = self.env['property.accounts.receivable'].create({ @@ -46,6 +46,7 @@ class PropertyRentalWizard(models.Model): acc_type = 'new' else: acc_type = None + if not rent_id: self.sudo().env["property.rent.list"].create({ "contract_id": record.id,