@@ -51,7 +51,7 @@ class MeterArchivesLine(models.Model):
|
||||
contract_name = fields.Char(string='合同名称')
|
||||
lessee_name = fields.Char(string='承租方名称')
|
||||
|
||||
@api.onchange('contract_id', 'lessee_id')
|
||||
@api.depends('archives_id', 'contract_id', 'lessee_id')
|
||||
def onchange_contract_lessee(self):
|
||||
if self.contract_id:
|
||||
self.contract_name = self.contract_id.name
|
||||
@@ -79,7 +79,7 @@ class MeterWaterLine(models.Model):
|
||||
contract_name = fields.Char(string='合同名称')
|
||||
lessee_name = fields.Char(string='承租方名称')
|
||||
|
||||
@api.onchange('contract_id', 'lessee_id')
|
||||
@api.depends('water_id', 'contract_id', 'lessee_id')
|
||||
def onchange_contract_lessee(self):
|
||||
if self.contract_id:
|
||||
self.contract_name = self.contract_id.name
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='yuthon_property_ids']" position="after">
|
||||
<field name="contract_id"/>
|
||||
<field name="contract_name" column_invisible="1"/>
|
||||
<field name="lessee_name" column_invisible="1"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
@@ -55,8 +57,8 @@
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='yuthon_property_ids']" position="after">
|
||||
<field name="contract_id"/>
|
||||
<field name="contract_name"/>
|
||||
<field name="lessee_name"/>
|
||||
<field name="contract_name" column_invisible="1"/>
|
||||
<field name="lessee_name" column_invisible="1"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
Reference in New Issue
Block a user