From 2580e0c795768ee0e533df03b08182c9207ea86a Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Tue, 2 Apr 2024 15:36:28 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BC=98=E5=8C=96=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E5=88=80=E5=85=B7=E7=89=A9=E6=96=99=E7=94=9F?= =?UTF-8?q?=E6=88=90=E7=9A=84=E5=BA=8F=E5=88=97=E5=8F=B7=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E4=B8=8D=E8=BF=9E=E7=BB=AD=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=9B?= =?UTF-8?q?2=E3=80=81=E9=87=87=E8=B4=AD=E5=88=80=E6=9F=84=E7=89=A9?= =?UTF-8?q?=E6=96=99=E6=97=B6=EF=BC=8C=E5=9C=A8=E5=85=A5=E5=BA=93=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E7=8E=AF=E8=8A=82=E5=A2=9E=E5=8A=A0Rfid=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E5=85=A8=E9=83=A8=E5=BD=95=E5=85=A5=E6=A3=80=E9=AA=8C?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/stock.py | 2 +- sf_warehouse/models/model.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sf_manufacturing/models/stock.py b/sf_manufacturing/models/stock.py index d777d48b..6ea88c4c 100644 --- a/sf_manufacturing/models/stock.py +++ b/sf_manufacturing/models/stock.py @@ -280,7 +280,7 @@ class ProductionLot(models.Model): if not last_serial: return "%s-%s%03d" % (product.cutting_tool_model_id.code[:-12], now, 1) else: - return "%s-%s%03d" % (product.cutting_tool_model_id.code[:-12], now, int(last_serial.name[-3:]) + 2) + return "%s-%s%03d" % (product.cutting_tool_model_id.code[:-12], now, int(last_serial.name[-3:]) + 1) else: raise ValidationError('该刀具物料产品的型号字段为空,请补充完整!!!') diff --git a/sf_warehouse/models/model.py b/sf_warehouse/models/model.py index 84e2a771..6e1dd356 100644 --- a/sf_warehouse/models/model.py +++ b/sf_warehouse/models/model.py @@ -749,6 +749,8 @@ class SfStockPicking(models.Model): if move and move.product_id.cutting_tool_material_id.name == '刀柄': for item in move.move_line_nosuggest_ids: if item.location_dest_id.name == '进货': + if not item.rfid: + raise ValidationError('你需要提供%s的Rfid' % move.product_id.name) self.env['stock.lot'].search([('name', '=', item.lot_name)]).write({'rfid': item.rfid}) return res