From 58fc9e2733cf61c0f2eee3d4585ef32980c045eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Voet=20=28ryv=29?= Date: Thu, 17 Dec 2020 09:51:53 +0000 Subject: [PATCH] [REF] stock: remove index on `name` of `stock_move` The `name` fields of `stock.move` is use differently (sometimes it is contains info of related product, other time the parent document, ...). But in all case we never search directly on the name of the move, then we remove the index related to. Also remove useless keyword `index=True` for the `backorder_id` task-2389380 --- addons/stock/models/stock_move.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py index ecdd4dab8c2..dfeaa578e1e 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -28,7 +28,7 @@ class StockMove(models.Model): return self.env['stock.picking'].browse(self.env.context['default_picking_id']).group_id.id return False - name = fields.Char('Description', index=True, required=True) + name = fields.Char('Description', required=True) sequence = fields.Integer('Sequence', default=10) priority = fields.Selection( PROCUREMENT_PRIORITIES, 'Priority', default='0', @@ -112,7 +112,7 @@ class StockMove(models.Model): price_unit = fields.Float( 'Unit Price', help="Technical field used to record the product cost set by the user during a picking confirmation (when costing " "method used is 'average price' or 'real'). Value given in company currency and in product uom.", copy=False) # as it's a technical field, we intentionally don't provide the digits attribute - backorder_id = fields.Many2one('stock.picking', 'Back Order of', related='picking_id.backorder_id', index=True, readonly=False) + backorder_id = fields.Many2one('stock.picking', 'Back Order of', related='picking_id.backorder_id', readonly=False) origin = fields.Char("Source Document") procure_method = fields.Selection([ ('make_to_stock', 'Default: Take From Stock'),