修改维保标准维保项目参数为One2many对象 并与设备,维保计划关联,修改原生维保计划方法 根据保养和检修生成不同的维保计划单

This commit is contained in:
qihao.gong@jikimo.com
2023-07-04 17:30:50 +08:00
parent 4199a86264
commit e6060b9bab
8 changed files with 241 additions and 52 deletions

View File

@@ -787,6 +787,10 @@ class MachineToolType(models.Model):
result = json.loads(r['result'])
if result['status'] == 1:
for item in result['machine_tool_type_all_list']:
if item.get('machine_tool_picture'):
image = base64.b64decode(item['machine_tool_picture'])
else:
image = ''
brand = self.env['sf.machine_tool.type'].search(
[("code", '=', item['code'])])
if not brand:
@@ -811,7 +815,7 @@ class MachineToolType(models.Model):
[('code', '=', item['control_system_id'])]).id,
"active": item['active'],
'brand_id': self.env['sf.machine.brand'].search([('code', '=', item['brand_id'])]).id,
'machine_tool_picture': base64.b64decode(item['machine_tool_picture']),
'machine_tool_picture':image,
"heightened_way": item['heightened_way'],
"workpiece_load": item['workpiece_load'],
"lead_screw": item['lead_screw'],