From 0ad7e72b15ae4141aa76fafb797024ee7c24a27c Mon Sep 17 00:00:00 2001
From: yuxianghui <3437689193@qq.com>
Date: Wed, 12 Jun 2024 16:28:42 +0800
Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E8=A7=A3=E5=86=B3=20=E5=88=80?=
=?UTF-8?q?=E5=85=B7=E7=BB=84=E8=A3=85=E9=80=89=E6=8B=A9=E7=9A=84=E6=89=B9?=
=?UTF-8?q?=E6=AC=A1=E5=8F=B7=E9=98=9F=E5=8F=8B=E7=89=A9=E6=96=99=E5=8F=AA?=
=?UTF-8?q?=E5=89=A9=E4=B8=8B1=E4=B8=AA=E6=97=B6-=E7=BB=84=E8=A3=85?=
=?UTF-8?q?=E5=AE=8C=E8=AF=A5=E5=8D=95=E6=8D=AE=E8=AF=A6=E6=83=85=E4=B8=8D?=
=?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=89=B9=E6=AC=A1=E4=BF=A1=E6=81=AF=20?=
=?UTF-8?q?=E7=9A=84bug=EF=BC=9B2=E3=80=81=E8=B0=83=E6=95=B4=E6=8B=86?=
=?UTF-8?q?=E8=A7=A3=E5=8D=95=E7=95=8C=E9=9D=A2=E5=B8=83=E5=B1=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_tool_management/models/base.py | 30 ++++++------
sf_tool_management/views/tool_base_views.xml | 50 ++++++++------------
sf_tool_management/wizard/wizard.py | 8 ++--
3 files changed, 38 insertions(+), 50 deletions(-)
diff --git a/sf_tool_management/models/base.py b/sf_tool_management/models/base.py
index 3f4031ce..39c43d8e 100644
--- a/sf_tool_management/models/base.py
+++ b/sf_tool_management/models/base.py
@@ -427,11 +427,11 @@ class FunctionalToolAssembly(models.Model):
sf_tool_brand_id_1 = fields.Many2one('sf.machine.brand', string='整体式刀具品牌',
related='integral_product_id.brand_id')
- @api.depends('integral_freight_barcode_id')
+ @api.depends('integral_lot_id')
def _compute_integral_product_id(self):
for item in self:
- if item.integral_freight_barcode_id:
- item.integral_product_id = item.integral_freight_barcode_id.product_id.id
+ if item.integral_lot_id:
+ item.integral_product_id = item.integral_lot_id.product_id.id
# =================刀片型号=============
blade_freight_barcode_id = fields.Many2one('sf.shelf.location', string='刀片货位')
@@ -444,11 +444,11 @@ class FunctionalToolAssembly(models.Model):
related='blade_product_id.specification_id')
sf_tool_brand_id_2 = fields.Many2one('sf.machine.brand', '刀片品牌', related='blade_product_id.brand_id')
- @api.depends('blade_freight_barcode_id')
+ @api.depends('blade_lot_id')
def _compute_blade_product_id(self):
for item in self:
- if item.blade_freight_barcode_id:
- item.blade_product_id = item.blade_freight_barcode_id.product_id.id
+ if item.blade_lot_id:
+ item.blade_product_id = item.blade_lot_id.product_id.id
# ==============刀杆型号================
bar_freight_barcode_id = fields.Many2one('sf.shelf.location', string='刀杆货位')
@@ -461,11 +461,11 @@ class FunctionalToolAssembly(models.Model):
related='bar_product_id.specification_id')
sf_tool_brand_id_3 = fields.Many2one('sf.machine.brand', '刀杆品牌', related='bar_product_id.brand_id')
- @api.depends('bar_freight_barcode_id')
+ @api.depends('bar_lot_id')
def _compute_bar_product_id(self):
for item in self:
- if item.bar_freight_barcode_id:
- item.bar_product_id = item.bar_freight_barcode_id.product_id.id
+ if item.bar_lot_id:
+ item.bar_product_id = item.bar_lot_id.product_id.id
# =============刀盘型号================
pad_freight_barcode_id = fields.Many2one('sf.shelf.location', string='刀盘货位')
@@ -478,11 +478,11 @@ class FunctionalToolAssembly(models.Model):
related='pad_product_id.specification_id')
sf_tool_brand_id_4 = fields.Many2one('sf.machine.brand', '刀盘品牌', related='pad_product_id.brand_id')
- @api.depends('pad_freight_barcode_id')
+ @api.depends('pad_lot_id')
def _compute_pad_product_id(self):
for item in self:
- if item.pad_freight_barcode_id:
- item.pad_product_id = item.pad_freight_barcode_id.product_id.id
+ if item.pad_lot_id:
+ item.pad_product_id = item.pad_lot_id.product_id.id
# ==============刀柄型号==============
handle_freight_rfid = fields.Char('刀柄Rfid', compute='_compute_handle_product_id', store=True)
@@ -516,11 +516,11 @@ class FunctionalToolAssembly(models.Model):
related='chuck_product_id.specification_id')
sf_tool_brand_id_6 = fields.Many2one('sf.machine.brand', '夹头品牌', related='chuck_product_id.brand_id')
- @api.depends('chuck_freight_barcode_id')
+ @api.depends('chuck_lot_id')
def _compute_chuck_product_id(self):
for item in self:
- if item.chuck_freight_barcode_id:
- item.chuck_product_id = item.chuck_freight_barcode_id.product_id.id
+ if item.chuck_lot_id:
+ item.chuck_product_id = item.chuck_lot_id.product_id.id
# ==================待删除字段==================
integral_freight_barcode = fields.Char('整体式刀具货位')
diff --git a/sf_tool_management/views/tool_base_views.xml b/sf_tool_management/views/tool_base_views.xml
index 3366c52e..050b4d21 100644
--- a/sf_tool_management/views/tool_base_views.xml
+++ b/sf_tool_management/views/tool_base_views.xml
@@ -804,90 +804,78 @@
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
+
+
+
-
-
-
-
-
+
+
+
-
-
-
-
-
+
+
+
-
-
-
-
-
+
+
+
diff --git a/sf_tool_management/wizard/wizard.py b/sf_tool_management/wizard/wizard.py
index 40dbcc52..6aec47e9 100644
--- a/sf_tool_management/wizard/wizard.py
+++ b/sf_tool_management/wizard/wizard.py
@@ -617,6 +617,10 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
# 创建组装入库单
# 创建功能刀具批次/序列号记录
stock_lot = product_id.create_assemble_warehouse_receipt(self.id, functional_tool_assembly, self)
+ # 封装功能刀具数据,用于更新组装单信息
+ desc_1 = self.get_desc_1(stock_lot)
+ # 封装功能刀具数据,用于创建功能刀具记录
+ desc_2 = self.get_desc_2(stock_lot, functional_tool_assembly)
# 创建刀具组装入库单
self.env['stock.picking'].create_stocking_picking(stock_lot, functional_tool_assembly, self)
# 刀具物料出库
@@ -639,8 +643,6 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
self.chuck_freight_lot_id, self.assembly_order_code)
# ============================创建功能刀具列表、安全库存记录===============================
- # 封装功能刀具数据
- desc_2 = self.get_desc_2(stock_lot, functional_tool_assembly)
# 创建功能刀具列表记录
record_1 = self.env['sf.functional.cutting.tool.entity'].create(desc_2)
# 创建安全库存信息
@@ -649,8 +651,6 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
}, record_1)
# =====================修改功能刀具组装单、机床换刀申请、CAM工单程序用刀计划的状态==============
- # 封装功能刀具数据
- desc_1 = self.get_desc_1(stock_lot)
# 修改功能刀具组装单信息
functional_tool_assembly.write(desc_1)
if functional_tool_assembly.sf_machine_table_tool_changing_apply_id: