From 33f30be05a13fe5e2ad2d75778eb2d68c9eba56f 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: Mon, 3 Nov 2025 10:06:08 +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/wizard/task_push_wizard.py | 6 +- .../models/property_lease_contract.py | 63 ++----------------- .../wizard/property_reconciliation_wizard.py | 3 +- 3 files changed, 11 insertions(+), 61 deletions(-) diff --git a/yuthon_property/wizard/task_push_wizard.py b/yuthon_property/wizard/task_push_wizard.py index fb31aaddd..c8fdd0996 100644 --- a/yuthon_property/wizard/task_push_wizard.py +++ b/yuthon_property/wizard/task_push_wizard.py @@ -45,7 +45,7 @@ class TaskPushWizard(models.TransientModel): 'original_amount': meter.archives_id.fixed_receivables if meter.archives_id.fixed_receivables else meter.receivables, 'due_date': due_date, 'due_date_end': due_date_end, - 'charging_range': f"{start_date.strftime('%Y-%m-%d')} 到 {(end_date - timedelta(days=1)).strftime('%Y-%m-%d')}", + 'charging_range': f"{start_date.strftime('%Y-%m-%d')} 到 {(end_date).strftime('%Y-%m-%d')}", 'create_time': datetime.now(), 'remark': remark, 'management_type_id': management_type_id.id, @@ -70,7 +70,7 @@ class TaskPushWizard(models.TransientModel): 'original_amount': water.water_id.fixed_receivables if water.water_id.fixed_receivables else water.receivables, 'due_date': due_date, 'due_date_end': due_date_end, - 'charging_range': f"{start_date.strftime('%Y-%m-%d')} 到 {(end_date - timedelta(days=1)).strftime('%Y-%m-%d')}", + 'charging_range': f"{start_date.strftime('%Y-%m-%d')} 到 {(end_date).strftime('%Y-%m-%d')}", 'create_time': datetime.now(), 'remark': remark, 'management_type_id': management_type_id.id, @@ -94,7 +94,7 @@ class TaskPushWizard(models.TransientModel): prev_month = meter_month - 1 prev_year = meter_year prev_month_same_day = fields.Date.from_string(f"{prev_year}-{prev_month}-{meter_day}") - start_date = prev_month_same_day.replace(day=15) + timedelta(days=1) + start_date = prev_month_same_day.replace(day=14) end_date = meter_date.replace(day=15) diff --git a/yuthon_property_approval/models/property_lease_contract.py b/yuthon_property_approval/models/property_lease_contract.py index ba262c2da..145027415 100644 --- a/yuthon_property_approval/models/property_lease_contract.py +++ b/yuthon_property_approval/models/property_lease_contract.py @@ -1648,47 +1648,7 @@ class PropertyLeaseContract(models.Model): 'address_id':lease_id.address_id.id, 'evaluate_unit_price': lease_id.evaluate_unit_price, }]) - breakdown_list = [] - if record.breakdown_ids: - for breakdown_id in record.breakdown_ids: - breakdown_list.append([0, 0, { - 'breakdown_id':contract_id.id, - 'charges': breakdown_id.charges, - 'unit_price': breakdown_id.unit_price, - 'monthly_amount': breakdown_id.monthly_amount, - 'start_data': breakdown_id.start_data, - 'end_data': breakdown_id.end_data, - 'month_number': breakdown_id.month_number, - 'period_rent': breakdown_id.period_rent, - }]) - water_fee_list = [] - if record.water_fee_ids: - for water_fee_id in record.water_fee_ids: - water_fee_list.append([0, 0, { - 'contract_id':contract_id.id, - 'address_id':water_fee_id.address_id.id, - 'charges': water_fee_id.charges, - 'fees_id': water_fee_id.fees_id.id, - 'proportional': water_fee_id.proportional, - }]) - electricity_fee_list = [] - if record.electricity_fee_ids: - for electricity_fee_id in record.electricity_fee_ids: - electricity_fee_list.append([0, 0, { - 'contract_id':contract_id.id, - 'charges': electricity_fee_id.charges, - 'fees_id': electricity_fee_id.fees_id.id, - 'proportional': electricity_fee_id.proportional, - }]) - mange_fee_list = [] - if record.mange_fee_ids: - for mange_fee_id in record.mange_fee_ids: - mange_fee_list.append([0, 0, { - 'contract_id': contract_id.id, - 'charges': mange_fee_id.charges, - 'fees_id': mange_fee_id.fees_id.id, - 'proportional': mange_fee_id.proportional, - }]) + other_list = [] if record.other_ids: for other_id in record.other_ids: @@ -1698,19 +1658,13 @@ class PropertyLeaseContract(models.Model): 'coping': other_id.coping.id, 'coping_time': other_id.coping_time, }]) + rent_list = [] if record.breakdown_ids: - for rent in record.breakdown_ids: - rent_list.append([0, 0, { - 'contract_id': contract_id.id, - }]) + rent_list.append([0, 0, { + 'contract_id': contract_id.id, + }]) - # management_list = [] - # if record.management_list_ids: - # for record in record.management_list_ids: - # management_list.append([0, 0, { - # 'contract_id': contract_id.id, - # }]) subset_list = [] subset_list.append([0, 0, { 'subset_id': record.id, @@ -1718,12 +1672,7 @@ class PropertyLeaseContract(models.Model): record.subset_ids = subset_list contract_id.write({ 'lease_ids': lease_list, - 'breakdown_ids': breakdown_list, - 'water_fee_ids': water_fee_list, - 'electricity_fee_ids': electricity_fee_list, - 'mange_fee_ids': mange_fee_list, - 'other_ids': other_list, - 'rent_list_ids': rent_list,}) + 'other_ids': other_list,}) # 'management_list_ids':management_list,}) return { diff --git a/yuthon_property_approval/wizard/property_reconciliation_wizard.py b/yuthon_property_approval/wizard/property_reconciliation_wizard.py index c10374f42..452e4e814 100644 --- a/yuthon_property_approval/wizard/property_reconciliation_wizard.py +++ b/yuthon_property_approval/wizard/property_reconciliation_wizard.py @@ -38,7 +38,7 @@ class PropertyReconciliationWizard(models.Model): rec.remake = rec.bank_id.remake rec.amount_water_been = rec.bank_id.yes_amount rec.amount_water = rec.bank_id.no_amount - rec.amount_reconciled = rec.bank_id.no_amount - sum(line.amount for line in rec.reconciliation_line_ids) + @api.depends('reconciliation_line_ids') def _compute_receivable_total(self): @@ -294,6 +294,7 @@ class PropertyReconciliationWizard(models.Model): self.write({'reconciliation_line_ids': missing_penalty_lines}) self.create_reconciliation_vals() + self.amount_reconciled = self.bank_id.no_amount - sum(line.amount for line in self.reconciliation_line_ids) def create_reconciliation_vals(self): """