!4683 添加功能

Merge pull request !4683 from 李鹏宇/dev_zhou
This commit is contained in:
李鹏宇
2025-08-21 08:05:48 +00:00
committed by Gitee
@@ -57,6 +57,32 @@ class PropertyBankStatements(models.Model):
])
if bank_lines:
tenant_id = bank_lines[0].tenant_id.id
rec.bank_state = 'not_reconciled'
rec.registered = 0
rec.no_amount = rec.original_amount
rec.yes_amount = 0
penalty_records = self.env['property.accounts.receivable'].search([('bank_id', '=', self.id)])
if not penalty_records:
penalty_records = self.env['property.accounts.receivable'].search([
('due_date', '=', start_date),
('lessee_id', '=', tenant_id),
('contract_id', 'in', rec.contract_ids.ids),
('property_id', 'in', rec.property_ids.ids),
('management_type_id', '=', penalty_type.id)
])
to_restore = penalty_records.filtered(lambda r: r.is_write)
if to_restore:
to_restore.write({'is_write': False,
'due_date_end': None,
'delivered1': None,
'is_reconciliation': False,
'payout_date': None,
})
return
to_delete = penalty_records.filtered(lambda r: not r.is_write)
if to_delete:
to_delete.unlink()
accounts = self.env['property.accounts.receivable'].search([
('payout_date', '=', start_date),
('lessee_id', '=', tenant_id),
@@ -64,41 +90,15 @@ class PropertyBankStatements(models.Model):
('property_id', 'in', rec.property_ids.ids),
('management_type_id', '!=', penalty_type.id),
])
rec.bank_state = 'not_reconciled'
rec.registered = 0
rec.no_amount = rec.original_amount
rec.yes_amount = 0
if accounts:
for account in accounts:
account.write({'is_reconciliation': False,
'payout_date': False,
'delivered1': 0,
'due_date_end' :None,
'reconciliation_time': False,
'remark':None,
'due_date_end': None,
'reconciliation_time': False,
'remark': None,
})
penalty_records = self.env['property.accounts.receivable'].search([('bank_id', '=', self.id)])
if not penalty_records:
penalty_records = self.env['property.accounts.receivable'].search([
('due_date', '=', start_date),
('lessee_id', '=', tenant_id),
('contract_id', 'in', rec.contract_ids.ids),
('property_id', 'in', rec.property_ids.ids),
('management_type_id', '=', penalty_type.id)
])
to_restore = penalty_records.filtered(lambda r: r.is_write)
if to_restore:
to_restore.write({'is_write': False,
'due_date_end': None,
'delivered1': None,
'is_reconciliation': False,
'payout_date': None,
})
return
to_delete = penalty_records.filtered(lambda r: not r.is_write)
if to_delete:
to_delete.unlink()
def binding_information(self):
return {