From d3f64910efcdcc54bb9edde1d38d47fac9176159 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: Tue, 10 Mar 2026 10:08:28 +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_property_approval/wizard/property_rental_wizard.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yuthon_property_approval/wizard/property_rental_wizard.py b/yuthon_property_approval/wizard/property_rental_wizard.py index 54e711ee6..f7b297006 100644 --- a/yuthon_property_approval/wizard/property_rental_wizard.py +++ b/yuthon_property_approval/wizard/property_rental_wizard.py @@ -30,19 +30,19 @@ class PropertyRentalWizard(models.Model): if multiplier == 1: first_day_of_month = start_date.replace(day=1) else: - first_day_of_month = start_date.replace(day=1) - relativedelta(months=multiplier) + first_day_of_month = start_date.replace(day=2) - relativedelta(months=multiplier) last_day_of_month = start_date.replace(day=1) + relativedelta(months=multiplier) - timedelta(days=1) rent_id = self.env['property.rent.list'].search([ ('contract_id', '=', record.id), ('property_id', '=', property_id), - ('due_date', '>', first_day_of_month), + ('due_date', '>=', first_day_of_month), ('due_date', '<=', last_day_of_month), ]) # 判断是否有已生成应收 existing_receivable = self.env['property.accounts.receivable'].search([ ('lessee_id', '=', record.lessee_id.id), - ('due_date', '>', first_day_of_month), + ('due_date', '>=', first_day_of_month), ('due_date', '<=', last_day_of_month), ('management_type_id.name', '=', '租金'), ('contract_id', '=', record.id),