Browse Source

publish muk_utils - 12.0

pull/9/head
MuK IT GmbH 5 years ago
parent
commit
5378f2dbae
  1. 2
      muk_utils/__manifest__.py
  2. 7
      muk_utils/models/mixins_hierarchy.py

2
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",

7
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]))):

Loading…
Cancel
Save