Skip to content
Snippets Groups Projects
Commit ccefa18b authored by Florent de Labarre's avatar Florent de Labarre Committed by GitHub
Browse files

[IMP] stock: add index on the serial name


In large database with unique serial number. The index add performance.

closes odoo/odoo#78024

Signed-off-by: default avatarWilliam Henrotin <Whenrow@users.noreply.github.com>
parent 38447f80
Branches
Tags
No related merge requests found
......@@ -17,7 +17,7 @@ class ProductionLot(models.Model):
name = fields.Char(
'Lot/Serial Number', default=lambda self: self.env['ir.sequence'].next_by_code('stock.lot.serial'),
required=True, help="Unique Lot/Serial Number")
required=True, help="Unique Lot/Serial Number", index=True)
ref = fields.Char('Internal Reference', help="Internal reference number in case it differs from the manufacturer's lot/serial number")
product_id = fields.Many2one(
'product.product', 'Product', index=True,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment