diff --git a/addons/mrp/models/mrp_production.py b/addons/mrp/models/mrp_production.py index 2d196731d62..29c85436ab7 100644 --- a/addons/mrp/models/mrp_production.py +++ b/addons/mrp/models/mrp_production.py @@ -228,7 +228,7 @@ class MrpProduction(models.Model): 'procurement.group', 'Procurement Group', copy=False) product_description_variants = fields.Char('Custom Description') - orderpoint_id = fields.Many2one('stock.warehouse.orderpoint', 'Orderpoint') + orderpoint_id = fields.Many2one('stock.warehouse.orderpoint', 'Orderpoint', index=True) propagate_cancel = fields.Boolean( 'Propagate cancel and split', help='If checked, when the previous move of the move (which was generated by a next procurement) is cancelled or split, the move generated by this move will too') diff --git a/addons/purchase_stock/models/purchase.py b/addons/purchase_stock/models/purchase.py index e842866951c..30eca2ce820 100644 --- a/addons/purchase_stock/models/purchase.py +++ b/addons/purchase_stock/models/purchase.py @@ -277,7 +277,7 @@ class PurchaseOrderLine(models.Model): qty_received_method = fields.Selection(selection_add=[('stock_moves', 'Stock Moves')]) move_ids = fields.One2many('stock.move', 'purchase_line_id', string='Reservation', readonly=True, copy=False) - orderpoint_id = fields.Many2one('stock.warehouse.orderpoint', 'Orderpoint', copy=False) + orderpoint_id = fields.Many2one('stock.warehouse.orderpoint', 'Orderpoint', copy=False, index=True) move_dest_ids = fields.One2many('stock.move', 'created_purchase_line_id', 'Downstream Moves') product_description_variants = fields.Char('Custom Description') propagate_cancel = fields.Boolean('Propagate cancellation', default=True) diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py index f9802ca3be6..56f0747140b 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -167,7 +167,7 @@ class StockMove(models.Model): display_assign_serial = fields.Boolean(compute='_compute_display_assign_serial') next_serial = fields.Char('First SN') next_serial_count = fields.Integer('Number of SN') - orderpoint_id = fields.Many2one('stock.warehouse.orderpoint', 'Original Reordering Rule', check_company=True) + orderpoint_id = fields.Many2one('stock.warehouse.orderpoint', 'Original Reordering Rule', check_company=True, index=True) forecast_availability = fields.Float('Forecast Availability', compute='_compute_forecast_information', digits='Product Unit of Measure', compute_sudo=True) forecast_expected_date = fields.Datetime('Forecasted Expected date', compute='_compute_forecast_information', compute_sudo=True) lot_ids = fields.Many2many('stock.production.lot', compute='_compute_lot_ids', inverse='_set_lot_ids', string='Serial Numbers', readonly=False)