From 20cfbf7230fb5abeb7018ea71a5f0787095c1688 Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Thu, 28 Nov 2024 17:50:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=20=20=E5=9D=AF=E6=96=99?= =?UTF-8?q?=E7=9A=84=E5=88=B6=E9=80=A0=E8=AE=A2=E5=8D=95=E7=94=9F=E6=88=90?= =?UTF-8?q?=E7=9A=84=E6=89=B9=E6=AC=A1=E5=BA=8F=E5=88=97=E5=8F=B7=E4=B8=8D?= =?UTF-8?q?=E5=AF=B9=20=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/stock.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sf_manufacturing/models/stock.py b/sf_manufacturing/models/stock.py index 4162ed68..b8cb237a 100644 --- a/sf_manufacturing/models/stock.py +++ b/sf_manufacturing/models/stock.py @@ -424,6 +424,8 @@ class ProductionLot(models.Model): """Generate `lot_names` from a string.""" if first_lot.__contains__(display_name): first_lot = first_lot[(len(display_name) + 1):] + else: + first_lot = first_lot[-3:] # We look if the first lot contains at least one digit. caught_initial_number = regex_findall(r"\d+", first_lot)