diff --git a/yuthon_property_approval/wizard/property_rental_wizard.py b/yuthon_property_approval/wizard/property_rental_wizard.py index b1a6c4d68..1b20961a8 100644 --- a/yuthon_property_approval/wizard/property_rental_wizard.py +++ b/yuthon_property_approval/wizard/property_rental_wizard.py @@ -125,11 +125,9 @@ class PropertyRentalWizard(models.Model): ] # 判断是否有已生成押金 first_day_of_month = due_date.replace(day=1) - last_day_of_month = first_day_of_month + relativedelta(months=1) - timedelta(days=1) existing_receivable = self.env['property.accounts.receivable'].search([ ('lessee_id', '=', record.lessee_id.id), - ('due_date', '>=', first_day_of_month), - ('due_date', '<=', last_day_of_month), + ('due_date', '=', first_day_of_month), ('management_type_id.name', '=', '押金'), ('company_id', '=', record.lessor_id.id), ('contract_id.contract_code', '=', record.contract_code), @@ -292,6 +290,7 @@ class PropertyRentalWizard(models.Model): records = self.env['property.lease.contract'].search(domain +[ ('actual_start_time', '<', next_month_first_day), ('actual_end_time', '>=', first_day), + ('contract_code', '=', '租(2023)22号') ]) if not records: records = self.env['property.lease.contract'].search(domain +[