diff --git a/sf_manufacturing/controllers/controllers.py b/sf_manufacturing/controllers/controllers.py index 70b0b87b..7203f19c 100644 --- a/sf_manufacturing/controllers/controllers.py +++ b/sf_manufacturing/controllers/controllers.py @@ -445,32 +445,7 @@ class Manufacturing_Connect(http.Controller): shelfinfo = list(filter(lambda x: x.get('DeviceId') == DeciveId, request.env['sf.shelf.location'].sudo().get_sf_shelf_location_info( DeciveId))) - total_data = request.env['sf.shelf.location.datasync'].sudo().get_total_data() - for item in shelfinfo: - logging.info('货架已获取信息:%s' % item) - shelf_barcode = request.env['sf.shelf.location.datasync'].sudo().find_our_code( - total_data, item['Postion']) - location_id = request.env['sf.shelf.location'].sudo().search( - [('barcode', '=', shelf_barcode)], - limit=1) - if location_id: - # 如果是线边刀库信息,则对功能刀具移动生成记录 - if 'Tool' in item['Postion']: - tool = request.env['sf.functional.cutting.tool.entity'].sudo().search( - [('rfid', '=', item['RfidCode']), ('functional_tool_status', '!=', '已拆除')]) - tool.sudo().tool_in_out_stock_location(location_id) - if tool: - location_id.product_sn_id = tool.barcode_id.id - # 修改功能刀具状态 - if item.get('State') == '报警': - if tool.functional_tool_status != item.get('State'): - tool.write({ - 'functional_tool_status': item['State'] - }) - else: - location_id.product_sn_id = False - if item['RfidCode']: - logging.info('Rfid为【%s】的功能刀具在系统中不存在!' % item['RfidCode']) + request.env['sf.shelf.location.datasync'].sudo().set_shelf_location(shelfinfo) else: equipment_id = request.env['maintenance.equipment'].sudo().search([('name', '=', DeciveId)]) if equipment_id: diff --git a/sf_tool_management/models/functional_tool.py b/sf_tool_management/models/functional_tool.py index dcbca0e7..2568dc89 100644 --- a/sf_tool_management/models/functional_tool.py +++ b/sf_tool_management/models/functional_tool.py @@ -58,20 +58,6 @@ class FunctionalCuttingToolEntity(models.Model): safe_inventory_id = fields.Many2one('sf.real.time.distribution.of.functional.tools', string='功能刀具安全库存', readonly=True) - @api.onchange('functional_tool_status') - def _onchange_functional_tool_status(self): - for item in self: - if item: - if item.functional_tool_status == '报警': - self.create_tool_dismantle() - - def set_functional_tool_status(self): - # self.write({ - # 'functional_tool_status': '报警' - # }) - self.functional_tool_status = '报警' - self.create_tool_dismantle() - def create_tool_dismantle(self): for item in self: # 创建报警刀具拆解单 diff --git a/sf_tool_management/views/functional_tool_views.xml b/sf_tool_management/views/functional_tool_views.xml index 25b9346a..a306d6dd 100644 --- a/sf_tool_management/views/functional_tool_views.xml +++ b/sf_tool_management/views/functional_tool_views.xml @@ -42,7 +42,6 @@
-