From e3423d3f2843fb88328c3e998b7e6654daa97d2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Voet=20=28ryv=29?= Date: Thu, 17 Dec 2020 09:42:46 +0000 Subject: [PATCH] [REF] stock,mrp: remove index of `priority` fields Indexed of boolean values is quite useless and the one of `priority` (MO/Pickings) can be only used in filter search view (`starred`). Then remove priority indexes from `stock_move`, `stock_picking` and `mrp_production`. task-2389380 --- addons/mrp/models/mrp_production.py | 2 +- addons/stock/models/stock_move.py | 2 +- addons/stock/models/stock_picking.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/mrp/models/mrp_production.py b/addons/mrp/models/mrp_production.py index 309babb0364..cbcbf024057 100644 --- a/addons/mrp/models/mrp_production.py +++ b/addons/mrp/models/mrp_production.py @@ -74,7 +74,7 @@ class MrpProduction(models.Model): name = fields.Char( 'Reference', copy=False, readonly=True, default=lambda x: _('New')) priority = fields.Selection( - PROCUREMENT_PRIORITIES, string='Priority', default='0', index=True, + PROCUREMENT_PRIORITIES, string='Priority', default='0', help="Components will be reserved first for the MO with the highest priorities.") backorder_sequence = fields.Integer("Backorder Sequence", default=0, copy=False, help="Backorder sequence, if equals to 0 means there is not related backorder") origin = fields.Char( diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py index 1545bd32345..ecdd4dab8c2 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -32,7 +32,7 @@ class StockMove(models.Model): sequence = fields.Integer('Sequence', default=10) priority = fields.Selection( PROCUREMENT_PRIORITIES, 'Priority', default='0', - compute="_compute_priority", store=True, index=True) + compute="_compute_priority", store=True) date = fields.Datetime( 'Date Scheduled', default=fields.Datetime.now, index=True, required=True, help="Scheduled date until move is done, then date of actual move processing") diff --git a/addons/stock/models/stock_picking.py b/addons/stock/models/stock_picking.py index 7e87cbe736d..d00395cc8f6 100644 --- a/addons/stock/models/stock_picking.py +++ b/addons/stock/models/stock_picking.py @@ -279,7 +279,7 @@ class Picking(models.Model): 'procurement.group', 'Procurement Group', readonly=True, related='move_lines.group_id', store=True) priority = fields.Selection( - PROCUREMENT_PRIORITIES, string='Priority', default='0', index=True, + PROCUREMENT_PRIORITIES, string='Priority', default='0', help="Products will be reserved first for the transfers with the highest priorities.") scheduled_date = fields.Datetime( 'Scheduled Date', compute='_compute_scheduled_date', inverse='_set_scheduled_date', store=True,