Accept Merge Request #415: (feature/修改机床参数bug -> develop)
Merge Request: 修改机床注册接口 Created By: @龚启豪 Accepted By: @龚启豪 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/415?initial=true
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
<field name="machine_tool_picture" widget="image"/>
|
||||
<label for="enroll_machine_tool"/>
|
||||
<div class="col-12 col-lg-6 o_setting_box" style="white-space: nowrap">
|
||||
<button type="object" class="oe_highlight" name='enroll_machine_tool' string="机床注册"/>
|
||||
<button type="object" class="oe_highlight" name='enroll_machine_tool' string="机床注册" attrs="{'invisible': [('equipment_type', '!=', '机床'), ('brand_id','!=',False),('type_id','!=',False),('control_system_id','!=',False)]}"/>
|
||||
</div>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='category_id']" position="after">
|
||||
@@ -128,9 +128,7 @@
|
||||
</div>
|
||||
<field name="workpiece_load"
|
||||
attrs="{'required': [('equipment_type', '=', '机床')]}"/>
|
||||
<field name="number_of_knife_library"
|
||||
attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
options="{'format': false}"/>
|
||||
|
||||
<field name="lead_screw" attrs="{'required': [('equipment_type', '=', '机床')]}"/>
|
||||
<field name="number_of_axles"
|
||||
attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
@@ -209,6 +207,9 @@
|
||||
</group>
|
||||
</div>
|
||||
<group string="刀具">
|
||||
<field name="number_of_knife_library"
|
||||
attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||
options="{'format': false}"/>
|
||||
<field name="knife_type" attrs="{'required': [('equipment_type', '=', '机床')]}"/>
|
||||
<field name="tool_speed" attrs="{'required': [('equipment_type', '=', '机床')]}"/>
|
||||
<field name="tool_long_max"
|
||||
|
||||
Reference in New Issue
Block a user