[IMP] stock: remove _parent_store=True from model stock.quant.package
The model does not actually need this feature, as the hierarchies of packages are not expected to be deep. Performance wise, updating columns `parent_left` and `parent_right` may actually suffer from concurrent updates that require retrying requests.
This commit is contained in:
@@ -559,10 +559,7 @@ class QuantPackage(models.Model):
|
||||
""" Packages containing quants and/or other packages """
|
||||
_name = "stock.quant.package"
|
||||
_description = "Physical Packages"
|
||||
_parent_name = "parent_id"
|
||||
_parent_store = True
|
||||
_parent_order = 'name'
|
||||
_order = 'parent_left'
|
||||
_order = 'name'
|
||||
|
||||
name = fields.Char(
|
||||
'Package Reference', copy=False, index=True,
|
||||
@@ -575,8 +572,6 @@ class QuantPackage(models.Model):
|
||||
ancestor_ids = fields.One2many('stock.quant.package', string='Ancestors', compute='_compute_ancestor_ids')
|
||||
children_quant_ids = fields.One2many('stock.quant', string='All Bulk Content', compute='_compute_children_quant_ids')
|
||||
children_ids = fields.One2many('stock.quant.package', 'parent_id', 'Contained Packages', readonly=True)
|
||||
parent_left = fields.Integer('Left Parent', index=True)
|
||||
parent_right = fields.Integer('Right Parent', index=True)
|
||||
packaging_id = fields.Many2one(
|
||||
'product.packaging', 'Package Type', index=True,
|
||||
help="This field should be completed only if everything inside the package share the same product, otherwise it doesn't really makes sense.")
|
||||
|
||||
Reference in New Issue
Block a user