@@ -301,13 +301,12 @@ class PropertyLeaseContract(models.Model):
|
||||
is_issues = fields.Boolean(string='是否上会')
|
||||
issues_result = fields.Html(string="会议结果")
|
||||
related_issues_id = fields.Many2one('issue.library', string="关联议题")
|
||||
chu_fa = fields.Boolean(string="", compute='action_view_contract')
|
||||
|
||||
@api.model
|
||||
def get_view(self, view_id=None, view_type='form', **options):
|
||||
res = super(PropertyLeaseContract, self).get_view(view_id=view_id, view_type=view_type, **options)
|
||||
if view_type == 'form' and self._context.get('active_id'):
|
||||
# 获取当前选中的主模型记录
|
||||
record = self.browse(self._context.get('active_id'))
|
||||
@api.depends('contract_code')
|
||||
def action_view_contract(self):
|
||||
self.ensure_one()
|
||||
for record in self:
|
||||
total_month_number = 0
|
||||
if record.term_start_time and record.term_end_time:
|
||||
delta = relativedelta(record.term_end_time, record.term_start_time)
|
||||
@@ -342,7 +341,7 @@ class PropertyLeaseContract(models.Model):
|
||||
'management_month_number': total_month_number,
|
||||
})
|
||||
|
||||
return res
|
||||
record.chu_fa = True
|
||||
|
||||
@api.onchange('is_issues')
|
||||
def _onchange_is_issues(self):
|
||||
@@ -1866,6 +1865,7 @@ class PropertyLeaseContract(models.Model):
|
||||
new_contract.write({
|
||||
'admin_id': original_contract.admin_id,
|
||||
'contract_code': None,
|
||||
'work_end': False,
|
||||
'lease_term_year': None,
|
||||
'term_start_time': new_term_start,
|
||||
'term_end_time': None,
|
||||
|
||||
@@ -476,6 +476,7 @@
|
||||
<group>
|
||||
<group>
|
||||
<field name="name" invisible="1"/>
|
||||
<field name="chu_fa" invisible="1"/>
|
||||
<field name="contract_id" invisible="contract_type != 'lease_renewal'"/>
|
||||
<field name="rent_company" string="出租方" invisible="contract_sort != 'property'"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
@@ -746,7 +747,7 @@
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="水费" invisible="not is_water">
|
||||
<page string="水表信息" invisible="not is_water">
|
||||
<field name="water_fee_ids" string=" ">
|
||||
<tree editable="bottom">
|
||||
<field name="contract_id" column_invisible="1"/>
|
||||
@@ -759,7 +760,7 @@
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="电费" invisible="not is_electricity">
|
||||
<page string="电表信息" invisible="not is_electricity">
|
||||
<field name="electricity_fee_ids" string=" ">
|
||||
<tree editable="bottom">
|
||||
<field name="contract_id" column_invisible="1"/>
|
||||
|
||||
@@ -118,7 +118,6 @@ class PropertyRentalWizard(models.Model):
|
||||
b.end_data >= first_day_of_month
|
||||
)
|
||||
original_amount = matched_breakdowns.management_monthly_amount
|
||||
|
||||
else:
|
||||
original_amount = rent_amount
|
||||
|
||||
|
||||
Reference in New Issue
Block a user