添加功能

This commit is contained in:
zhou
2025-01-03 14:46:47 +08:00
parent 14a2c0a6dd
commit b13cd6c626
3 changed files with 14 additions and 7 deletions
+1 -7
View File
@@ -88,7 +88,7 @@ class YuthonProperty(models.Model):
'management_area':latest_record_id.management_area,
'rent_area': latest_record_id.rent_area,
'admin_id':latest_record_id.admin_id.id,
'company_id':latest_record_id.company_id,
'company_id':latest_record_id.company_id.id,
})
@api.onchange('property_archives_id')
@@ -271,12 +271,6 @@ class YuthonProperty(models.Model):
"target": "new",
}
# @api.onchange('property_meter_archives_id')
# def _onchange_water_meter_ids(self):
# for rec in self:
# rec.property_meter_archives_id.write({'yuthon_property_id': rec.property_meter_archives_id.id})
class TitleInformationLine(models.Model):
_name = 'title.information.line'
_description = '产权信息明细行'
@@ -485,6 +485,12 @@ class PropertyLeaseContract(models.Model):
rec.electricity_fee_ids = electricity_list
rec.mange_fee_ids = fee_list
def trigger_lease_ids(self):
property_ids = self.env["property.lease.contract"].browse(self._context.get('active_ids', self._context.get('active_id')))
for record in property_ids:
company_id = record.lease_ids[0].address_id.company_id.id if record.lease_ids else ''
record.company_id = company_id
def action_yuthon_property_contract_wizard(self):
return {
"type": "ir.actions.act_window",
@@ -261,4 +261,11 @@
<field name="state">code</field>
<field name="code">action = model.action_relevance_property()</field>
</record>
<record id="all_data_update_property_lease" model="ir.actions.server">
<field name="name">更新出租方信息</field>
<field name="model_id" ref="yuthon_property_approval.model_property_lease_contract"/>
<field name="binding_model_id" ref="yuthon_property_approval.model_property_lease_contract"/>
<field name="state">code</field>
<field name="code">action = model.trigger_lease_ids()</field>
</record>
</odoo>