!4716 添加功能

Merge pull request !4716 from 李鹏宇/dev_zhou
This commit is contained in:
李鹏宇
2025-08-22 10:51:50 +00:00
committed by Gitee
@@ -4,6 +4,8 @@ from dateutil.relativedelta import relativedelta
from odoo.exceptions import UserError, ValidationError
import re
import logging
_logger = logging.getLogger(__name__)
class PropertyReconciliationWizard(models.Model):
_name = 'property.reconciliation.wizard'
@@ -340,6 +342,7 @@ class PropertyReconciliationWizard(models.Model):
is_reconciliation = line.amount == round(line.rent, 2)
if not existing_record:
_logger.info(f"为找到对应的应收日期{existing_record.due_date}{existing_record.property_id.name}的记录,创建新记录")
domain2 = [
('due_date', '=', line.due_date),
('property_id', '=', line.property_id.id),
@@ -373,7 +376,7 @@ class PropertyReconciliationWizard(models.Model):
'is_write': True if line.amount != 0 else None,
'reconciliation_time': fields.Datetime.now(),
})
print(f"已更新记录 - 物业: {line.property_id.name if line.property_id else '未知'}, 应收日期: {existing_record.due_date}")
_logger.info(f"已更新记录 - 物业: {line.property_id.name if line.property_id else '未知'}, 应收日期: {existing_record.due_date}")
# 计算已对账和未对账金额
rec.amount_been_reconciled += line.amount