This commit is contained in:
pengyuthon
2025-10-19 00:32:30 +08:00
parent 9136ae704e
commit e2f53c280e
2 changed files with 7 additions and 6 deletions
@@ -43,6 +43,7 @@ class PropertyMeterArchives(models.Model):
else:
record.contract_id = False
class MeterArchivesLine(models.Model):
_inherit = 'meter.archives.line'
@@ -51,7 +52,7 @@ class MeterArchivesLine(models.Model):
contract_name = fields.Char(string='合同名称', store=True, index=True, compute="_compute_name")
lessee_name = fields.Char(string='承租方名称', store=True, index=True, compute="_compute_name")
@api.depends('archives_id', 'contract_id', 'lessee_id')
@api.depends('yuthon_property_ids', 'archives_id', 'contract_id', 'lessee_id')
def _compute_name(self):
for name in self:
if name.contract_id:
@@ -80,7 +81,7 @@ class MeterWaterLine(models.Model):
contract_name = fields.Char(string='合同名称', store=True, index=True, compute="_compute_name")
lessee_name = fields.Char(string='承租方名称', store=True, index=True, compute="_compute_name")
@api.depends('water_id', 'contract_id', 'lessee_id')
@api.depends('yuthon_property_ids', 'water_id', 'contract_id', 'lessee_id')
def _compute_name(self):
for name in self:
if name.contract_id:
@@ -27,8 +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"/>
<field name="contract_name" column_invisible="1" readonly="0"/>
<field name="lessee_name" column_invisible="1" readonly="0"/>
</xpath>
</field>
</record>
@@ -57,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" column_invisible="1"/>
<field name="lessee_name" column_invisible="1"/>
<field name="contract_name" column_invisible="1" readonly="0"/>
<field name="lessee_name" column_invisible="1" readonly="0"/>
</xpath>
</field>
</record>