From b2e47e27ac497e189cfc8a9841d9b05581796d46 Mon Sep 17 00:00:00 2001 From: sebalix Date: Tue, 28 Aug 2018 14:59:32 +0200 Subject: [PATCH] [FIX] mrp_production_hierarchy: disable _parent_store mechanism (MPTT) to fix issues when using the `child_of` search operator. `(parent_left, parent_right)` duplicates can occur when creating multiple manufacturing orders in parallel, which mess up the result of the `child_of` search operator (wrong result returned). Related Odoo issue: https://github.com/odoo/odoo/pull/14515 Odoo fix (for `stock.quant.package` here): https://github.com/odoo/odoo/pull/14694 This issue should not be relevant anymore in 11.0 as the `child_of/parent_of` mechanism has been refactored (https://github.com/odoo/odoo/pull/22558) --- mrp_production_hierarchy/models/mrp_production.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/mrp_production_hierarchy/models/mrp_production.py b/mrp_production_hierarchy/models/mrp_production.py index 01bee2616..dfa9d6727 100644 --- a/mrp_production_hierarchy/models/mrp_production.py +++ b/mrp_production_hierarchy/models/mrp_production.py @@ -7,9 +7,6 @@ from odoo import api, fields, models, _ class MrpProduction(models.Model): _inherit = 'mrp.production' - _parent_name = "parent_id" - _parent_store = True - _parent_order = 'name' root_id = fields.Many2one( 'mrp.production', u"Root order", @@ -20,8 +17,6 @@ class MrpProduction(models.Model): child_ids = fields.One2many( 'mrp.production', 'parent_id', u"Child orders", domain=[('state', '!=', 'cancel')]) - parent_left = fields.Integer('Left Parent', index=True) - parent_right = fields.Integer('Right Parent', index=True) @api.multi def _generate_moves(self):