diff --git a/sf_maintenance/models/sf_maintenance.py b/sf_maintenance/models/sf_maintenance.py
index e9a945f7..ec704d6a 100644
--- a/sf_maintenance/models/sf_maintenance.py
+++ b/sf_maintenance/models/sf_maintenance.py
@@ -338,25 +338,28 @@ class SfMaintenanceEquipment(models.Model):
machine_tool_list = []
if objs_all:
for item in objs_all:
+ images_ids_names = []
+ for a in self.env['maintenance.equipment.image'].search([('id', 'in', item.image_id.ids)]):
+ images_ids_names.append(a.name)
if item.machine_tool_picture != False:
image = base64.b64encode(item.machine_tool_picture).decode('utf-8')
else:
image = False
+ control_system_id = self.env['sf.machine.control_system'].sudo().browse(item.control_system_id.id).code
+
val = {
'MTcode': item.MTcode,
'factory_token': token,
'id': item.id,
'name': item.name,
'code': item.code,
- 'precision': item.precision,
'knife_type': item.knife_type,
'number_of_knife_library': item.number_of_knife_library,
'rotate_speed': item.rotate_speed,
'number_of_axles': item.number_of_axles,
- 'control_system_id': self.env['sf.machine.control_system'].search(
- [('id', '=', item.control_system_id.id)]).code,
- 'type_id': self.env['sf.machine_tool.type'].search([('id', '=', item.type_id.id)]).code,
- 'brand_id': self.env['sf.machine.brand'].search([('id', '=', item.brand_id.id)]).code,
+ 'control_system_id': control_system_id,
+ 'type_id': self.env['sf.machine_tool.type'].sudo().browse(item.type_id.id).code,
+ 'brand_id': self.env['sf.machine.brand'].sudo().browse(item.brand_id.id).code,
'supplier_id': item.supplier_id.id,
'x_axis': item.x_axis,
'y_axis': item.y_axis,
@@ -377,15 +380,19 @@ class SfMaintenanceEquipment(models.Model):
'machine_tool_H': item.machine_tool_H,
'feed_speed': item.feed_speed,
'tool_speed': item.tool_speed,
- 'distance': item.distance,
'taper': item.taper,
'torque': item.torque,
'motor_power': item.motor_power,
'tool_quality_max': item.tool_quality_max,
'tool_long_max': item.tool_long_max,
'tool_diameter_max': item.tool_diameter_max,
+ 'precision_min': item.precision_min,
+ 'precision_max': item.precision_max,
+ 'distance_min': item.distance_min,
+ 'distance_max': item.distance_max,
+ 'tool_diameter_min': item.tool_diameter_min,
'machine_tool_category': item.machine_tool_category.code,
-
+ 'image_id': images_ids_names
}
machine_tool_list.append(val)
# kw = machine_tool_list
diff --git a/sf_maintenance/views/maintenance_views.xml b/sf_maintenance/views/maintenance_views.xml
index 65c559e9..8454bb1d 100644
--- a/sf_maintenance/views/maintenance_views.xml
+++ b/sf_maintenance/views/maintenance_views.xml
@@ -49,7 +49,7 @@