1、优化机床刀位接口,数据写入到机床的刀位的方法;2、制造-刀具管理菜单下的机床换刀申请菜单隐藏,功能菜单改为作业单;3、刀柄和托盘采购入库时,对录入的Rfid做唯一性校验;

This commit is contained in:
yuxianghui
2024-04-25 17:14:30 +08:00
parent 53ed0d76a6
commit 4bcd6b9944
4 changed files with 20 additions and 12 deletions

View File

@@ -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'])

View File

@@ -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"
/>

View File

@@ -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>

View File

@@ -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: