添加功能

This commit is contained in:
zhou
2025-08-15 11:28:09 +08:00
parent 3502391791
commit d7a1aa20d0
2 changed files with 28 additions and 5 deletions
@@ -91,11 +91,9 @@
</tree>
</field>
</group>
<group col="5">
<group col="3">
<group>
<field name="company_id"/>
</group>
<group>
<field name="tenure_type"/>
</group>
<!-- <group>-->
@@ -103,8 +101,6 @@
<!-- </group>-->
<group>
<field name="precinct_id"/>
</group>
<group>
<field name="purpose_id"/>
</group>
<group>
@@ -125,6 +125,26 @@ class PropertyReconciliationWizard(models.Model):
'sequence': int(line.sequence) + 1,
}
new_lines.append((0, 0, penalty_line_vals))
# 上月违约金未对账延续
receivable_penalties = self.env['property.accounts.receivable'].search([
('property_id', '=', line.property_id.id),
('contract_id', '=', line.contract_id.id),
('is_reconciliation', '=', False),
('management_type_id.name', '=', '违约金')
])
for penalty in receivable_penalties:
receivable_line_vals = {
'property_id': penalty.property_id.id,
'contract_id': penalty.contract_id.id,
'rent_month': 0,
'due_date': penalty.due_date,
'rent': penalty.submitted,
'amount': 0,
'collection_type': 'penalty',
'remake': penalty.remark,
'sequence': int(line.sequence) + 2,
}
new_lines.append((0, 0, receivable_line_vals))
if new_lines:
keep_lines = [
@@ -162,6 +182,13 @@ class PropertyReconciliationWizard(models.Model):
raise UserError(_(
"错误:物业 '%s' 的对账明细行金额与租金不符,备注信息为必填项,请填写备注后再试。"
) % line.property_id.name)
line_date = fields.Date.from_string(line.due_date)
rec_date = fields.Date.from_string(rec.actual_date)
if (line_date.year, line_date.month) != (rec_date.year, rec_date.month):
if not line.remake:
raise UserError(_(
"错误:物业 '%s' 的对账明细行月份与对账月份不符,备注信息为必填项,请填写备注后再试。"
) % line.property_id.name)
first_day = line.due_date.replace(day=1)
last_day = (first_day + relativedelta(months=1)) - relativedelta(days=1)
domain = [