[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
This commit is contained in:
Rémy Voet (ryv)
2020-12-22 12:42:59 +00:00
parent e3423d3f28
commit 58fc9e2733
+2 -2
View File
@@ -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'),