From 61b0b57b87207812fc1e7d6cd4c2e6246945528c Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Fri, 8 Mar 2024 17:31:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8A=9F=E8=83=BD=E5=88=80?= =?UTF-8?q?=E5=85=B7=E7=AD=89=E6=B3=A8=E5=86=8C=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_tool_management/models/functional_tool_enroll.py | 6 ++++-- sf_tool_management/models/tool_material_search.py | 2 +- sf_tool_management/views/tool_material_search.xml | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sf_tool_management/models/functional_tool_enroll.py b/sf_tool_management/models/functional_tool_enroll.py index cdd6c24c..2d2941f5 100644 --- a/sf_tool_management/models/functional_tool_enroll.py +++ b/sf_tool_management/models/functional_tool_enroll.py @@ -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, diff --git a/sf_tool_management/models/tool_material_search.py b/sf_tool_management/models/tool_material_search.py index 9e493bad..1812c489 100644 --- a/sf_tool_management/models/tool_material_search.py +++ b/sf_tool_management/models/tool_material_search.py @@ -311,7 +311,7 @@ class ToolMaterial(models.Model): product_id = fields.Many2one('product.product', string='刀具物料产品') name = fields.Char('名称', related='product_id.name') - code = fields.Char('编码', store=True) + code = fields.Char('编码', compute='_compute_code', store=True) cutting_tool_material_id = fields.Many2one('sf.cutting.tool.material', '刀具物料', related='product_id.cutting_tool_material_id', store=True, diff --git a/sf_tool_management/views/tool_material_search.xml b/sf_tool_management/views/tool_material_search.xml index 26552e2c..3f71c754 100644 --- a/sf_tool_management/views/tool_material_search.xml +++ b/sf_tool_management/views/tool_material_search.xml @@ -62,6 +62,7 @@ +