From 35c13dc51ca2a67f92cf353d5615da5fec926d45 Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Tue, 27 Aug 2024 16:12:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8A=A5=E5=BA=9F-=E5=9D=AF?= =?UTF-8?q?=E6=96=99=E5=BA=8F=E5=88=97=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sf_manufacturing/models/stock.py b/sf_manufacturing/models/stock.py index 27ce925a..76c51cff 100644 --- a/sf_manufacturing/models/stock.py +++ b/sf_manufacturing/models/stock.py @@ -440,7 +440,7 @@ class ProductionLot(models.Model): if product.tracking == "serial": last_serial = self.env['stock.lot'].search( [('company_id', '=', company.id), ('product_id', '=', product.id)], - limit=1, order='id DESC') + limit=1, order='name desc') if last_serial: if product.categ_id.name == '刀具': return self.env['stock.lot'].get_tool_generate_lot_names1(company, product)