优化功能刀具等注册接口
This commit is contained in:
@@ -25,7 +25,8 @@ class StockLot(models.Model):
|
||||
val = {
|
||||
'name': item.name,
|
||||
'tool_material_status': item.tool_material_status,
|
||||
'location': item.quant_ids[-1].location_id.name
|
||||
'location': item.quant_ids[-1].location_id.name,
|
||||
'tool_material_search_code': item.tool_material_search_id.code,
|
||||
}
|
||||
tool_material_stock_list.append(val)
|
||||
kw = json.dumps(tool_material_stock_list, ensure_ascii=False)
|
||||
@@ -89,7 +90,7 @@ class ToolMaterial(models.Model):
|
||||
kw = json.dumps(tool_material_list, ensure_ascii=False)
|
||||
r = requests.post(str_url, json={}, data={'kw': kw, 'token': token}, headers=headers)
|
||||
ret = r.json()
|
||||
if r == 200:
|
||||
if ret.get('code') == 200:
|
||||
return '刀具物料注册成功'
|
||||
else:
|
||||
raise UserError("没有注册刀具物料信息")
|
||||
@@ -116,6 +117,7 @@ class FunctionalCuttingToolEntity(models.Model):
|
||||
'id': item.id,
|
||||
'code': item.code,
|
||||
'name': item.name,
|
||||
'rfid': item.rfid,
|
||||
'tool_groups_name': item.tool_groups_id.name,
|
||||
'barcode': item.barcode_id.name,
|
||||
'cutting_tool_type_code': item.sf_cutting_tool_type_id.code,
|
||||
|
||||
Reference in New Issue
Block a user