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