租赁变更流程
This commit is contained in:
@@ -88,7 +88,24 @@ class PropertyLeaseRenewal(models.Model):
|
||||
|
||||
def end_approval(self):
|
||||
for rec in self:
|
||||
if rec.renewal_type == 'lease':
|
||||
if rec.renewal_type == 'extend':
|
||||
# 延长租期:修改原合同实际结束日期,并将租金明细写入原合同
|
||||
if rec.actual_end_date:
|
||||
rec.contract_id.write({
|
||||
'actual_end_time': rec.actual_end_date
|
||||
})
|
||||
if rec.breakdown_ids:
|
||||
for line in rec.breakdown_ids:
|
||||
self.env['property.rent.breakdown.line'].create({
|
||||
'breakdown_id': rec.contract_id.id,
|
||||
'unit_price': line.unit_price,
|
||||
'monthly_amount': line.monthly_amount,
|
||||
'start_data': line.start_data,
|
||||
'end_data': line.end_data,
|
||||
'month_number': line.month_number,
|
||||
'period_rent': line.period_rent,
|
||||
})
|
||||
elif rec.renewal_type == 'lease':
|
||||
origin_contract = rec.contract_id
|
||||
contract_actual_end = origin_contract.actual_end_time if origin_contract else None
|
||||
|
||||
@@ -141,7 +158,7 @@ class PropertyLeaseRenewal(models.Model):
|
||||
'management_type_id': management_type_id.id,
|
||||
'due_date': rec.effective_date,
|
||||
})
|
||||
else:
|
||||
elif rec.renewal_type == 'early_checkout':
|
||||
rec.contract_id.write({
|
||||
'actual_end_time': rec.early_quitting_date
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user