diff --git a/sf_tool_management/models/functional_tool.py b/sf_tool_management/models/functional_tool.py
index 09b2e973..73ee0896 100644
--- a/sf_tool_management/models/functional_tool.py
+++ b/sf_tool_management/models/functional_tool.py
@@ -113,7 +113,6 @@ class FunctionalCuttingToolEntity(models.Model):
item.tool_in_out_stock_location_1(location_id, tool_room_id)
# 新刀入库到线边
item.create_stock_move(pre_manufacturing_id, location_id)
- item.current_location_id = tool_room_id.id
item.current_shelf_location_id = location_id.id
# 中控反馈该位置没有刀
@@ -128,7 +127,6 @@ class FunctionalCuttingToolEntity(models.Model):
if tool.current_location == '线边刀库':
tool.create_stock_move(tool_room_id, False)
# 修改功能刀具的当前位置
- tool.current_location_id = tool_room_id.id
tool.current_shelf_location_id = False
def create_stock_move(self, location_dest_id, destination_location_id):
@@ -150,7 +148,6 @@ class FunctionalCuttingToolEntity(models.Model):
'move_id': stock_move_id.id,
'current_location_id': False if not self.current_shelf_location_id else self.current_shelf_location_id.id,
'destination_location_id': False if not destination_location_id else destination_location_id.id,
- 'install_tool_time': fields.Datetime.now(),
'qty_done': 1.0,
'state': 'done',
'functional_tool_type_id': self.sf_cutting_tool_type_id.id,
@@ -379,7 +376,7 @@ class StockMoveLine(models.Model):
functional_tool_name = fields.Char('刀具名称')
diameter = fields.Float(string='刀具直径(mm)')
knife_tip_r_angle = fields.Float(string='刀尖R角(mm)')
- install_tool_time = fields.Datetime("刀具组装时间", default=fields.Datetime.now())
+ install_tool_time = fields.Datetime("刀具组装时间")
code = fields.Char('编码')
rfid = fields.Char('Rfid')
tool_groups_id = fields.Many2one('sf.tool.groups', '刀具组')
diff --git a/sf_tool_management/models/maintenance_equipment.py b/sf_tool_management/models/maintenance_equipment.py
index d47369bc..ed6b09a1 100644
--- a/sf_tool_management/models/maintenance_equipment.py
+++ b/sf_tool_management/models/maintenance_equipment.py
@@ -99,8 +99,7 @@ class SfMaintenanceEquipment(models.Model):
'functional_tool_name_id': functional_tool_id.id,
'tool_install_time': time
})
- if (functional_tool_id.current_location_id.name != '制造前' or
- functional_tool_id.current_shelf_location_id):
+ if functional_tool_id.current_location != '机内刀库':
# 对功能刀具进行移动到生产线
functional_tool_id.tool_inventory_displacement_out()
functional_tool_id.write({
diff --git a/sf_tool_management/views/functional_tool_views.xml b/sf_tool_management/views/functional_tool_views.xml
index fa4a99bb..8d07bc70 100644
--- a/sf_tool_management/views/functional_tool_views.xml
+++ b/sf_tool_management/views/functional_tool_views.xml
@@ -202,9 +202,9 @@
-
+
@@ -468,7 +468,9 @@
+
+
@@ -483,21 +485,20 @@
stock.move.line
-
-
-
-
-
-
-
-
+
+
+
+
+
+
@@ -511,7 +512,7 @@
ref="sf_tool_management.sf_inbound_and_outbound_records_of_functional_tools_view_tree"/>
- [('functional_tool_name_id', '!=', False)]
+ [('functional_tool_name', '!=', False)]
diff --git a/sf_warehouse/models/sync_common.py b/sf_warehouse/models/sync_common.py
index ea90d06f..28f82313 100644
--- a/sf_warehouse/models/sync_common.py
+++ b/sf_warehouse/models/sync_common.py
@@ -108,6 +108,7 @@ class MrsShelfLocationDataSync(models.Model):
shelf_barcode = find_our_code(item['Postion'], total_data)
location_id = self.env['sf.shelf.location'].search([('barcode', '=', shelf_barcode)], limit=1)
if location_id:
+ # 如果是线边刀库信息,则对功能刀具移动生成记录
if 'Tool' in item['Postion']:
tool = self.env['sf.functional.cutting.tool.entity'].sudo().search(
[('rfid', '=', item['RfidCode']), ('functional_tool_status', '!=', '已拆除')])