修改sf设备修改过的需求
This commit is contained in:
@@ -42,14 +42,26 @@ class SfEquipmentSaintenanceStandards(models.Model):
|
||||
if record.maintenance_type == '检修':
|
||||
record.write({'overhaul_ids': [(6, 0, record.maintenance_equipment_ids.ids)]})
|
||||
|
||||
@api.onchange("maintenance_standards_ids")
|
||||
def _reset_work_order_sequence(self):
|
||||
for rec in self:
|
||||
current_sequence = 1
|
||||
for work in rec.maintenance_standards_ids:
|
||||
work.sequence = current_sequence
|
||||
current_sequence += 1
|
||||
|
||||
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('序列号')
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user