From 4796458899b8bedcbcf66b82199e446ae86ca38e 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, 28 Oct 2025 14:28:03 +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/models/property_management_list.py | 1 +
.../views/property_management_list_views.xml | 1 +
.../models/inherit_yuthon_property.py | 10 ++++++++--
.../wizard/property_rental_wizard.py | 8 ++++++++
4 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/yuthon_property/models/property_management_list.py b/yuthon_property/models/property_management_list.py
index 9fdf73724..1165284d2 100644
--- a/yuthon_property/models/property_management_list.py
+++ b/yuthon_property/models/property_management_list.py
@@ -16,6 +16,7 @@ class PropertyManagementList(models.Model):
area = fields.Float(string='面积')
remarks = fields.Text(string='备注')
is_push = fields.Boolean(string='是否推送')
+ type = fields.Selection([('management', '物业管理费') , ('guanzijian', '管子间管理费'), ('lightbox', '灯箱管理费')], string='类型')
@api.depends('property_ids')
def _compute_admin_id(self):
diff --git a/yuthon_property/views/property_management_list_views.xml b/yuthon_property/views/property_management_list_views.xml
index 12c1ad417..0631f1219 100644
--- a/yuthon_property/views/property_management_list_views.xml
+++ b/yuthon_property/views/property_management_list_views.xml
@@ -11,6 +11,7 @@
+
diff --git a/yuthon_property_approval/models/inherit_yuthon_property.py b/yuthon_property_approval/models/inherit_yuthon_property.py
index 2918850c0..27d8563da 100644
--- a/yuthon_property_approval/models/inherit_yuthon_property.py
+++ b/yuthon_property_approval/models/inherit_yuthon_property.py
@@ -509,7 +509,7 @@ class PropertyBankStatements(models.Model):
# 查询条件:同账号 + 交易时间早于当前 + 未对账
statements = self.env['property.bank.statements'].search([
('name', '=', account),
- ('start_time', '<', current_transaction_time),
+ ('start_time', '<', current_transaction_time - timedelta(hours=8)),
('bank_state', '=', 'not_reconciled'),
('id', '!=', self.id),
])
@@ -903,8 +903,14 @@ class PropertyAccountsReceivable(models.Model):
('meter_date', '<=', last_day)
])
else:
+ year = rec.due_date.year
+ month = rec.due_date.month
+ first_day = date(year, month, 1)
+ last_day = first_day - timedelta(days=1)
model_id = self.env[model_type].search([
- ('contract_id', '=', rec.contract_id.id)
+ ('contract_id', '=', rec.contract_id.id),
+ ('due_date', '>=', first_day),
+ ('due_date', '<=', last_day)
])
if model_id:
diff --git a/yuthon_property_approval/wizard/property_rental_wizard.py b/yuthon_property_approval/wizard/property_rental_wizard.py
index 3661d560f..d52d3a476 100644
--- a/yuthon_property_approval/wizard/property_rental_wizard.py
+++ b/yuthon_property_approval/wizard/property_rental_wizard.py
@@ -129,6 +129,12 @@ class PropertyRentalWizard(models.Model):
break
is_special_contract = record.contract_sort in ['guanggao', 'guanzi', 'room']
+ if record.contract_sort == 'guanggao':
+ type = 'lightbox'
+ elif record.contract_sort == 'guanzi':
+ type = 'guanzijian'
+ else:
+ type = 'management'
if (not is_special_contract and has_valid_property) or is_special_contract:
area_value = sum(
lease_id.property_area or 0.0
@@ -139,6 +145,7 @@ class PropertyRentalWizard(models.Model):
self.sudo().env["property.management.list"].create({
"contract_id": record.id,
"area":area_value,
+ "type": type,
'property_ids': [(6, 0, [lease_id.address_id.id for lease_id in record.lease_ids if lease_id.address_id])],
'original_amount':total_original_amount,
'message_standard_id': record.lease_ids[0].message_standard_id.id,
@@ -149,6 +156,7 @@ class PropertyRentalWizard(models.Model):
management_id.write({
"contract_id": record.id,
"area": area_value,
+ "type": type,
'property_ids': [(6, 0, [lease_id.address_id.id for lease_id in record.lease_ids if lease_id.address_id])],
'original_amount': total_original_amount,
'message_standard_id': record.lease_ids[0].message_standard_id.id,