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 @@ +