添加功能

This commit is contained in:
李鹏宇
2026-03-10 10:08:28 +08:00
parent 287e618267
commit d3f64910ef
@@ -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),