修改设备模块
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
""",
|
||||
'category': 'sf',
|
||||
'website': 'https://www.sf.jikimo.com',
|
||||
'depends': ['account', 'base', 'mrp'],
|
||||
'depends': ['account', 'base', 'mrp_workorder'],
|
||||
'data': [
|
||||
'security/group_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
|
||||
@@ -53,15 +53,11 @@ class SfEquipmentSaintenanceStandards(models.Model):
|
||||
class SfSaintenanceStandards(models.Model):
|
||||
_name = 'maintenance.standards'
|
||||
_description = '维保项目'
|
||||
_order = 'sequence, id'
|
||||
|
||||
name = fields.Char('维保项目')
|
||||
maintenance_standards = fields.Char('维保标准')
|
||||
equipment_maintenance_standards_id = fields.Many2one('equipment.maintenance.standards', string='设备维保标准')
|
||||
maintenance_request_id = fields.Many2one('maintenance.request', string='设备维保计划')
|
||||
cycle = fields.Integer('频次/周期')
|
||||
device_unit = fields.Char('设备单元')
|
||||
sequence = fields.Integer('序列号')
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -47,11 +47,6 @@ class SfMaintenanceEquipment(models.Model):
|
||||
overhaul_id = fields.Many2one('equipment.maintenance.standards', string='设备检修标准',
|
||||
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')
|
||||
def _compute_equipment_maintenance_standards_ids(self):
|
||||
|
||||
@@ -25,9 +25,7 @@ class SfMaintenanceEquipmentCategory(models.Model):
|
||||
if not record.equipment_maintenance_id:
|
||||
record.equipment_maintenance_id = False
|
||||
|
||||
|
||||
|
||||
maintenance_standards = fields.One2many('maintenance.standards','maintenance_request_id', string='维保标准', related='equipment_maintenance_id.maintenance_standards_ids')
|
||||
maintenance_standards = fields.One2many('maintenance.standards','maintenance_request_id', string='维保标准')
|
||||
|
||||
@api.constrains('equipment_maintenance_id')
|
||||
def _check_equipment_maintenance_id(self):
|
||||
|
||||
@@ -29,20 +29,6 @@
|
||||
<group>
|
||||
<field name="maintenance_equipment_ids" widget="many2many_tags" attrs="{'invisible': [('maintenance_equipment_category_id', '=', False)]}"/>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="维保项目">
|
||||
<field name="maintenance_standards_ids" widget="ony2many">
|
||||
<tree editable="top" create="true" string="维保项目">
|
||||
<field name="sequence"/>
|
||||
<field name="device_unit"/>
|
||||
<field name="name"/>
|
||||
<field name="maintenance_standards"/>
|
||||
<field name="cycle"/>
|
||||
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -160,8 +160,6 @@
|
||||
<xpath expr="//div[@class='o_row'][field[@name='maintenance_duration']]" position="after">
|
||||
|
||||
|
||||
<field name='eq_maintenance_maintenance_standards_ids'/>
|
||||
<field name='overhaul_maintenance_standards_ids'/>
|
||||
<field name='overhaul_id'/>
|
||||
<field name="overhaul_date" string="下次预防检修"/>
|
||||
<label for="overhaul_period" string="预防检修频次"/>
|
||||
|
||||
Reference in New Issue
Block a user