设备新需求(根据维保项目生成维保计划)

This commit is contained in:
qihao.gong@jikimo.com
2023-07-24 17:44:07 +08:00
parent abc7e1c8c6
commit 65157e93a9
3 changed files with 11 additions and 2 deletions

View File

@@ -47,6 +47,12 @@ class SfMaintenanceEquipment(models.Model):
overhaul_id = fields.Many2one('equipment.maintenance.standards', string='设备检修标准', overhaul_id = fields.Many2one('equipment.maintenance.standards', string='设备检修标准',
domain="[('maintenance_type','=','检修')]") domain="[('maintenance_type','=','检修')]")
eq_maintenance_maintenance_standards_ids = fields.One2many('maintenance.standards', 'maintenance_request_id', string='保养标准项目',
related='eq_maintenance_id.maintenance_standards_ids')
overhaul_maintenance_standards_ids = fields.One2many('maintenance.standards', 'maintenance_request_id', string='检修标准项目',
related='overhaul_id.maintenance_standards_ids')
@api.onchange('eq_maintenance_id', 'overhaul_id') @api.onchange('eq_maintenance_id', 'overhaul_id')
def _compute_equipment_maintenance_standards_ids(self): def _compute_equipment_maintenance_standards_ids(self):
for record in self: for record in self:

View File

@@ -34,9 +34,9 @@
<field name="maintenance_standards_ids" widget="ony2many"> <field name="maintenance_standards_ids" widget="ony2many">
<tree editable="top" create="true" string="维保项目"> <tree editable="top" create="true" string="维保项目">
<field name="sequence"/> <field name="sequence"/>
<field name="cycle"/>
<field name="name"/> <field name="name"/>
<field name="maintenance_standards"/> <field name="maintenance_standards"/>
<field name="cycle"/>
<field name="device_unit"/> <field name="device_unit"/>
</tree> </tree>
</field> </field>

View File

@@ -115,8 +115,11 @@
<xpath expr="//div[@class='o_row'][field[@name='maintenance_duration']]" position="after"> <xpath expr="//div[@class='o_row'][field[@name='maintenance_duration']]" position="after">
<field name='overhaul_id'/>
<field name='eq_maintenance_maintenance_standards_ids'/>
<field name='overhaul_maintenance_standards_ids'/>
<field name='overhaul_id'/>
<field name="overhaul_date" string="下次预防检修"/> <field name="overhaul_date" string="下次预防检修"/>
<label for="overhaul_period" string="预防检修频次"/> <label for="overhaul_period" string="预防检修频次"/>
<div class="o_row"> <div class="o_row">