修改胚料部分
This commit is contained in:
@@ -181,7 +181,7 @@ class StockRule(models.Model):
|
||||
|
||||
|
||||
class ProductionLot(models.Model):
|
||||
_inherit = 'stock.production.lot'
|
||||
_inherit = 'stock.lot'
|
||||
|
||||
@api.model
|
||||
def generate_lot_names1(self, display_name, first_lot, count):
|
||||
@@ -217,10 +217,10 @@ class ProductionLot(models.Model):
|
||||
def _get_next_serial(self, company, product):
|
||||
"""Return the next serial number to be attributed to the product."""
|
||||
if product.tracking == "serial":
|
||||
last_serial = self.env['stock.production.lot'].search(
|
||||
last_serial = self.env['stock.lot'].search(
|
||||
[('company_id', '=', company.id), ('product_id', '=', product.id)],
|
||||
limit=1, order='id DESC')
|
||||
if last_serial:
|
||||
return self.env['stock.production.lot'].generate_lot_names1(product.display_name, last_serial.name, 2)[
|
||||
return self.env['stock.lot'].generate_lot_names1(product.display_name, last_serial.name, 2)[
|
||||
1]
|
||||
return "%s-%03d" % (product.display_name, 1)
|
||||
|
||||
Reference in New Issue
Block a user