From eb2851391baf302db36978df4944493b2ae214ba Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Tue, 25 Jun 2024 12:06:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86"=E6=89=93=E5=8D=B0=E7=9A=84?= =?UTF-8?q?=E4=BA=8C=E7=BB=B4=E7=A0=81=E4=BF=A1=E6=81=AF=E4=B8=8E=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E7=9A=84=E4=BA=8C=E7=BB=B4=E7=A0=81=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E4=B8=8D=E4=B8=80=E8=87=B4"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_warehouse/models/model.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sf_warehouse/models/model.py b/sf_warehouse/models/model.py index 34fa57fe..ea39b757 100644 --- a/sf_warehouse/models/model.py +++ b/sf_warehouse/models/model.py @@ -622,6 +622,11 @@ class SfStockMoveLine(models.Model): if not qr_code_data: raise UserError("没有找到二维码数据。") lot_name = self.lot_name + + # 增加"当为坯料时,只打印序列号的前面部分" + if self.lot_name: # 确保 lot_name 存在 + if self.product_id.categ_id.name == '坯料': + lot_name = lot_name.split('[', 1)[0] # host = "192.168.50.110" # 可以根据实际情况修改 # port = 9100 # 可以根据实际情况修改 @@ -1184,6 +1189,12 @@ class CustomStockMove(models.Model): # todo 待控制 if not lot_name: raise ValidationError("请先分配序列号") + + # 增加"当为坯料时,只打印序列号的前面部分" + if record.lot_name: # 确保 lot_name 存在 + if record.product_id.categ_id.name == '坯料': + lot_name = lot_name.split('[', 1)[0] + # host = "192.168.50.110" # 可以根据实际情况修改 # port = 9100 # 可以根据实际情况修改