diff --git a/yuthon_property_approval/wizard/property_reconciliation_wizard.py b/yuthon_property_approval/wizard/property_reconciliation_wizard.py index a4bd24eff..c93f3e16e 100644 --- a/yuthon_property_approval/wizard/property_reconciliation_wizard.py +++ b/yuthon_property_approval/wizard/property_reconciliation_wizard.py @@ -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