Accept Merge Request #978: (feature/接口优化 -> develop)
Merge Request: 1、优化机床刀位接口,数据写入到机床的刀位的方法 Created By: @禹翔辉 Reviewed By: @马广威 Approved By: @马广威 Accepted By: @禹翔辉 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/978
This commit is contained in:
@@ -67,7 +67,7 @@ class SfMaintenanceEquipment(models.Model):
|
||||
equipment_tool_id = self.env['maintenance.equipment.tool'].sudo().search(
|
||||
[('equipment_id', '=', maintenance_equipment_id.id), ('code', '=', tool_id)])
|
||||
functional_tool_id = self.env['sf.functional.cutting.tool.entity'].sudo().search(
|
||||
[('rfid', '=', str(int(data['RfidCode'])))])
|
||||
[('rfid', '=', data['RfidCode'])])
|
||||
time = None
|
||||
if data['AddDatetime']:
|
||||
datatime = str(data['AddDatetime'])
|
||||
|
||||
@@ -23,13 +23,13 @@
|
||||
parent="menu_sf_tool_manage"
|
||||
/>
|
||||
|
||||
<menuitem
|
||||
sequence="10"
|
||||
name="机床换刀申请"
|
||||
id="menu_sf_machine_table_tool_changing_apply"
|
||||
action="sf_machine_table_tool_changing_apply_view_act"
|
||||
parent="menu_sf_function_tool_plan"
|
||||
/>
|
||||
<!-- <menuitem-->
|
||||
<!-- sequence="10"-->
|
||||
<!-- name="机床换刀申请"-->
|
||||
<!-- id="menu_sf_machine_table_tool_changing_apply"-->
|
||||
<!-- action="sf_machine_table_tool_changing_apply_view_act"-->
|
||||
<!-- parent="menu_sf_function_tool_plan"-->
|
||||
<!-- />-->
|
||||
<menuitem
|
||||
sequence="20"
|
||||
name="CAM工单程序用刀计划"
|
||||
@@ -42,7 +42,7 @@
|
||||
<!-- ================功能菜单================= -->
|
||||
<menuitem
|
||||
sequence="5"
|
||||
name="功能"
|
||||
name="作业单"
|
||||
id="menu_sf_function_tool_function"
|
||||
parent="menu_sf_tool_manage"
|
||||
/>
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
<button string="获取机床刀库信息" name="register_equipment_tool" type="object" class="btn-primary"/>
|
||||
<field name='product_template_ids'>
|
||||
<tree editable='bottom'>
|
||||
<field name="code" readonly="false"/>
|
||||
<field name="code" readonly="1"/>
|
||||
<field name="tool_code"/>
|
||||
<field name="functional_tool_type"/>
|
||||
<field name="functional_tool_name_id"/>
|
||||
<field name="functional_tool_name_id" readonly="1"/>
|
||||
<field name="image" widget="image"/>
|
||||
<field name="tool_groups"/>
|
||||
<field name="diameter"/>
|
||||
@@ -23,7 +23,7 @@
|
||||
<field name="life_value_max"/>
|
||||
<field name="alarm_value"/>
|
||||
<field name="used_value"/>
|
||||
<field name="tool_install_time"/>
|
||||
<field name="tool_install_time" readonly="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
|
||||
@@ -1006,6 +1006,14 @@ class CustomStockMove(models.Model):
|
||||
"""
|
||||
for record in self:
|
||||
if record:
|
||||
lot = self.env['stock.lot'].sudo().search([('rfid', '=', barcode)])
|
||||
if lot:
|
||||
if lot.product_id.cutting_tool_material_id:
|
||||
material = lot.product_id.cutting_tool_material_id.name
|
||||
else:
|
||||
material = lot.product_id.fixture_material_id.name
|
||||
raise ValidationError(
|
||||
'该Rfid【%s】已经被序列号为【%s】的【%s】物料所占用!' % (barcode, lot.name, material))
|
||||
if '刀柄' in (record.product_id.cutting_tool_material_id.name or '') or '托盘' in (
|
||||
record.product_id.fixture_material_id.name or ''):
|
||||
for move_line_nosuggest_id in record.move_line_nosuggest_ids:
|
||||
|
||||
Reference in New Issue
Block a user