[IMP] mrp: performance on move

With a database that contains a lot of production with kits or
BoM with a lot of bom.line. The database could become slow.

Index on stock.move <-> mrp.production could improve it.

closes odoo/odoo#51870

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
This commit is contained in:
Arnold Moyaux
2020-05-26 11:33:50 +00:00
parent 3c6ad3ce4a
commit e26b94405c
+2 -2
View File
@@ -69,9 +69,9 @@ class StockMove(models.Model):
created_production_id = fields.Many2one('mrp.production', 'Created Production Order', check_company=True)
production_id = fields.Many2one(
'mrp.production', 'Production Order for finished products', check_company=True)
'mrp.production', 'Production Order for finished products', check_company=True, index=True)
raw_material_production_id = fields.Many2one(
'mrp.production', 'Production Order for components', check_company=True)
'mrp.production', 'Production Order for components', check_company=True, index=True)
unbuild_id = fields.Many2one(
'mrp.unbuild', 'Disassembly Order', check_company=True)
consume_unbuild_id = fields.Many2one(