This commit is contained in:
jinling.yang
2024-04-26 09:56:59 +08:00
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_tool_id = self.env['maintenance.equipment.tool'].sudo().search(
[('equipment_id', '=', maintenance_equipment_id.id), ('code', '=', tool_id)]) [('equipment_id', '=', maintenance_equipment_id.id), ('code', '=', tool_id)])
functional_tool_id = self.env['sf.functional.cutting.tool.entity'].sudo().search( functional_tool_id = self.env['sf.functional.cutting.tool.entity'].sudo().search(
[('rfid', '=', str(int(data['RfidCode'])))]) [('rfid', '=', data['RfidCode'])])
time = None time = None
if data['AddDatetime']: if data['AddDatetime']:
datatime = str(data['AddDatetime']) datatime = str(data['AddDatetime'])

View File

@@ -23,13 +23,13 @@
parent="menu_sf_tool_manage" parent="menu_sf_tool_manage"
/> />
<menuitem <!-- <menuitem-->
sequence="10" <!-- sequence="10"-->
name="机床换刀申请" <!-- name="机床换刀申请"-->
id="menu_sf_machine_table_tool_changing_apply" <!-- id="menu_sf_machine_table_tool_changing_apply"-->
action="sf_machine_table_tool_changing_apply_view_act" <!-- action="sf_machine_table_tool_changing_apply_view_act"-->
parent="menu_sf_function_tool_plan" <!-- parent="menu_sf_function_tool_plan"-->
/> <!-- />-->
<menuitem <menuitem
sequence="20" sequence="20"
name="CAM工单程序用刀计划" name="CAM工单程序用刀计划"
@@ -42,7 +42,7 @@
<!-- ================功能菜单================= --> <!-- ================功能菜单================= -->
<menuitem <menuitem
sequence="5" sequence="5"
name="功能" name="作业单"
id="menu_sf_function_tool_function" id="menu_sf_function_tool_function"
parent="menu_sf_tool_manage" parent="menu_sf_tool_manage"
/> />

View File

@@ -12,10 +12,10 @@
<button string="获取机床刀库信息" name="register_equipment_tool" type="object" class="btn-primary"/> <button string="获取机床刀库信息" name="register_equipment_tool" type="object" class="btn-primary"/>
<field name='product_template_ids'> <field name='product_template_ids'>
<tree editable='bottom'> <tree editable='bottom'>
<field name="code" readonly="false"/> <field name="code" readonly="1"/>
<field name="tool_code"/> <field name="tool_code"/>
<field name="functional_tool_type"/> <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="image" widget="image"/>
<field name="tool_groups"/> <field name="tool_groups"/>
<field name="diameter"/> <field name="diameter"/>
@@ -23,7 +23,7 @@
<field name="life_value_max"/> <field name="life_value_max"/>
<field name="alarm_value"/> <field name="alarm_value"/>
<field name="used_value"/> <field name="used_value"/>
<field name="tool_install_time"/> <field name="tool_install_time" readonly="1"/>
</tree> </tree>
</field> </field>
</page> </page>

View File

@@ -1006,6 +1006,14 @@ class CustomStockMove(models.Model):
""" """
for record in self: for record in self:
if record: 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 ( if '刀柄' in (record.product_id.cutting_tool_material_id.name or '') or '托盘' in (
record.product_id.fixture_material_id.name or ''): record.product_id.fixture_material_id.name or ''):
for move_line_nosuggest_id in record.move_line_nosuggest_ids: for move_line_nosuggest_id in record.move_line_nosuggest_ids: