diff --git a/muk_utils/__manifest__.py b/muk_utils/__manifest__.py index 04183ac..bd07fda 100644 --- a/muk_utils/__manifest__.py +++ b/muk_utils/__manifest__.py @@ -19,7 +19,7 @@ { "name": "MuK Utils", "summary": """Utility Features""", - "version": '12.0.1.4.4', + "version": '12.0.1.4.5', "category": 'Extra Tools', "license": "AGPL-3", "author": "MuK IT", diff --git a/muk_utils/models/mixins_hierarchy.py b/muk_utils/models/mixins_hierarchy.py index f40b07c..4eeea63 100644 --- a/muk_utils/models/mixins_hierarchy.py +++ b/muk_utils/models/mixins_hierarchy.py @@ -69,10 +69,11 @@ class Hierarchy(models.AbstractModel): @api.depends('parent_path') def _compute_parent_path(self): - paths = [list(map(int, rec.parent_path.split('/')[:-1])) for rec in self] - ids = set(functools.reduce(operator.concat, paths)) + records = self.filtered(lambda record: record.parent_path) + paths = [list(map(int, rec.parent_path.split('/')[:-1])) for rec in records] + ids = paths and set(functools.reduce(operator.concat, paths)) or [] data = dict(self.browse(ids)._filter_access('read').name_get()) - for record in self: + for record in records: path_names = [""] path_json = [] for id in reversed(list(map(int, record.parent_path.split('/')[:-1]))):