From f4926820fe080c35b49e148af59b049297e64792 Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Wed, 5 Jun 2024 17:18:18 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=B8=85=E9=99=A4=E5=88=80=E5=85=B7?= =?UTF-8?q?=E7=89=A9=E6=96=99=E7=9A=84=E8=87=AA=E5=8A=A8=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E6=96=B9=E6=B3=95=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../models/functional_tool_enroll.py | 52 ------------------- .../models/maintenance_equipment.py | 5 +- .../models/tool_material_search.py | 2 - 3 files changed, 1 insertion(+), 58 deletions(-) diff --git a/sf_tool_management/models/functional_tool_enroll.py b/sf_tool_management/models/functional_tool_enroll.py index 0d076ddf..73b20a30 100644 --- a/sf_tool_management/models/functional_tool_enroll.py +++ b/sf_tool_management/models/functional_tool_enroll.py @@ -156,14 +156,6 @@ class ToolMaterial(models.Model): except Exception as e: logging.info("捕获错误信息:%s" % e) - @api.model_create_multi - def create(self, vals_list): - records = super(ToolMaterial, self).create(vals_list) - for record in records: - if record: - record.enroll_tool_material() - return records - class FunctionalCuttingToolEntity(models.Model): _inherit = 'sf.functional.cutting.tool.entity' @@ -248,20 +240,6 @@ class FunctionalCuttingToolEntity(models.Model): except Exception as e: logging.info("捕获错误信息:%s" % e) - @api.model_create_multi - def create(self, vals_list): - records = super(FunctionalCuttingToolEntity, self).create(vals_list) - for record in records: - if record: - record.enroll_functional_tool_entity() - return records - - def write(self, vals): - res = super().write(vals) - if vals.get('current_location'): - self.enroll_functional_tool_entity() - return res - class FunctionalToolWarning(models.Model): _inherit = 'sf.functional.tool.warning' @@ -332,14 +310,6 @@ class FunctionalToolWarning(models.Model): except Exception as e: logging.info("捕获错误信息:%s" % e) - @api.model_create_multi - def create(self, vals_list): - records = super(FunctionalToolWarning, self).create(vals_list) - for record in records: - if record: - record.enroll_functional_tool_warning() - return records - class StockMoveLine(models.Model): _inherit = 'stock.move.line' @@ -401,14 +371,6 @@ class StockMoveLine(models.Model): except Exception as e: logging.info("捕获错误信息:%s" % e) - @api.model_create_multi - def create(self, vals_list): - records = super(StockMoveLine, self).create(vals_list) - for record in records: - if record.functional_tool_name_id: - record.enroll_functional_tool_move() - return records - class RealTimeDistributionFunctionalTools(models.Model): _inherit = 'sf.real.time.distribution.of.functional.tools' @@ -481,17 +443,3 @@ class RealTimeDistributionFunctionalTools(models.Model): logging.info('没有注册功能刀具出入库记录信息') except Exception as e: logging.info("捕获错误信息:%s" % e) - - @api.model_create_multi - def create(self, vals_list): - records = super(RealTimeDistributionFunctionalTools, self).create(vals_list) - for record in records: - if record: - record.enroll_functional_tool_real_time_distribution() - return records - - def write(self, vals): - res = super().write(vals) - if vals.get('sf_functional_tool_entity_ids') or vals.get('min_stock_num') or vals.get('max_stock_num'): - self.enroll_functional_tool_real_time_distribution() - return res diff --git a/sf_tool_management/models/maintenance_equipment.py b/sf_tool_management/models/maintenance_equipment.py index 5486b2f6..a700da50 100644 --- a/sf_tool_management/models/maintenance_equipment.py +++ b/sf_tool_management/models/maintenance_equipment.py @@ -134,10 +134,7 @@ class StockLot(models.Model): record.tool_material_status = '报废' else: record.tool_material_status = '未入库' - if record.tool_material_search_id: - # 注册刀具物料状态到cloud平台 - record.enroll_tool_material_stock() - elif record.fixture_material_search_id: + if record.fixture_material_search_id: # 注册夹具物料状态到cloud平台 record.enroll_fixture_material_stock() diff --git a/sf_tool_management/models/tool_material_search.py b/sf_tool_management/models/tool_material_search.py index ee60c048..e26eab2b 100644 --- a/sf_tool_management/models/tool_material_search.py +++ b/sf_tool_management/models/tool_material_search.py @@ -45,8 +45,6 @@ class ToolMaterial(models.Model): record.have_been_used_num = have_been_used_num record.scrap_num = scrap_num record.number = usable_num + have_been_used_num + scrap_num - # 更新数据到cloud的动态数据 - record.enroll_tool_material() @api.model def _read_group_cutting_tool_material_id(self, categories, domain, order):