From 0ffc6244bd1500df429a3af8cef9f2d642d0654e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Beau?= Date: Sat, 14 Dec 2019 14:00:11 +0100 Subject: [PATCH] IMP stk_mts_mto_rule: Add missing index In case of big table adding the index on mts_mto_procurement_id improve the speed to read of mts_mto_procurement_ids --- stock_mts_mto_rule/__openerp__.py | 2 +- stock_mts_mto_rule/model/procurement.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/stock_mts_mto_rule/__openerp__.py b/stock_mts_mto_rule/__openerp__.py index 67640dd6b..faff1942a 100644 --- a/stock_mts_mto_rule/__openerp__.py +++ b/stock_mts_mto_rule/__openerp__.py @@ -21,7 +21,7 @@ ############################################################################## {'name': 'Stock MTS+MTO Rule', - 'version': '9.0.1.0.0', + 'version': '9.0.1.1.0', 'author': 'Akretion,Odoo Community Association (OCA)', 'website': 'http://www.akretion.com', 'license': 'AGPL-3', diff --git a/stock_mts_mto_rule/model/procurement.py b/stock_mts_mto_rule/model/procurement.py index 14d66b2cf..bc3a07473 100644 --- a/stock_mts_mto_rule/model/procurement.py +++ b/stock_mts_mto_rule/model/procurement.py @@ -28,7 +28,8 @@ class ProcurementOrder(models.Model): mts_mto_procurement_id = fields.Many2one( 'procurement.order', string="Mto+Mts Procurement", - copy=False) + copy=False, + index=True) mts_mto_procurement_ids = fields.One2many( 'procurement.order', 'mts_mto_procurement_id',