From 77ad0dd63541ec14b170c063840a9d5a39e6b6ff Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Mon, 17 Jun 2024 11:40:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8A=A8=E6=80=81=E5=88=80?= =?UTF-8?q?=E5=85=B7=E6=8C=89=E6=89=B9=E6=AC=A1=E7=AE=A1=E7=90=86=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=90=8C=E6=AD=A5=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 | 9 +++------ sf_tool_management/views/tool_material_search.xml | 1 + 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/sf_tool_management/models/functional_tool_enroll.py b/sf_tool_management/models/functional_tool_enroll.py index cad8bd20..25c31710 100644 --- a/sf_tool_management/models/functional_tool_enroll.py +++ b/sf_tool_management/models/functional_tool_enroll.py @@ -80,7 +80,7 @@ class StockLot(models.Model): headers = Common.get_headers(self, token, sf_secret_key) str_url = sf_sync_config['sf_url'] + "/api/tool_material_stock/create" product_ids = self.env['product.product'].sudo().search([('categ_type', '=', '刀具')]).ids - objs_all = self.env['stock.lot'].search([('rfid', '!=', False), ('product_id', 'in', product_ids)]) + objs_all = self.env['stock.lot'].search([('product_id', 'in', product_ids)]) self._get_sync_stock_lot(objs_all, str_url, token, headers) def _get_sync_stock_lot(self, objs_all, str_url, token, headers): @@ -90,6 +90,7 @@ class StockLot(models.Model): for item in objs_all: val = { 'name': item.name, + 'qty': item.product_qty, 'tool_material_status': item.tool_material_status, 'location': [] if not item.quant_ids else item.quant_ids[-1].location_id.name, 'tool_material_search_id': item.tool_material_search_id.id, @@ -105,7 +106,7 @@ class StockLot(models.Model): logging.info("没有刀具物料序列号信息") except Exception as e: logging.info("刀具物料序列号同步失败:%s" % e) - + class ToolMaterial(models.Model): _inherit = 'sf.tool.material.search' @@ -163,8 +164,6 @@ class ToolMaterial(models.Model): logging.info("刀具物料同步失败:%s" % e) - - class FunctionalCuttingToolEntity(models.Model): _inherit = 'sf.functional.cutting.tool.entity' _description = '功能刀具列表注册' @@ -251,8 +250,6 @@ class FunctionalCuttingToolEntity(models.Model): logging.info("功能刀具同步失败:%s" % e) - - class FunctionalToolWarning(models.Model): _inherit = 'sf.functional.tool.warning' _description = '功能刀具预警注册' diff --git a/sf_tool_management/views/tool_material_search.xml b/sf_tool_management/views/tool_material_search.xml index eb7a2418..8a740676 100644 --- a/sf_tool_management/views/tool_material_search.xml +++ b/sf_tool_management/views/tool_material_search.xml @@ -62,6 +62,7 @@ +