diff --git a/muk_utils/__manifest__.py b/muk_utils/__manifest__.py index 23bf776..1dc3ca3 100644 --- a/muk_utils/__manifest__.py +++ b/muk_utils/__manifest__.py @@ -20,7 +20,7 @@ { "name": "MuK Utils", "summary": """Utility Features""", - "version": '12.0.1.1.2', + "version": '12.0.1.1.3', "category": 'Extra Tools', "license": "AGPL-3", "author": "MuK IT", @@ -33,7 +33,7 @@ "base_setup", ], "data": [ - "views/groups.xml", + "views/mixins_groups.xml", "views/res_config_settings_view.xml", ], "qweb": [ diff --git a/muk_utils/models/__init__.py b/muk_utils/models/__init__.py index f65b089..473763a 100644 --- a/muk_utils/models/__init__.py +++ b/muk_utils/models/__init__.py @@ -17,7 +17,7 @@ # ################################################################################### -from . import groups +from . import mixins_groups from . import ir_attachment from . import res_config_settings diff --git a/muk_utils/models/groups.py b/muk_utils/models/mixins_groups.py similarity index 89% rename from muk_utils/models/groups.py rename to muk_utils/models/mixins_groups.py index 1988efd..86e0bf6 100644 --- a/muk_utils/models/groups.py +++ b/muk_utils/models/mixins_groups.py @@ -21,7 +21,7 @@ from odoo import models, fields, api class Groups(models.AbstractModel): - _name = 'muk_utils.groups' + _name = 'muk_utils.mixins.groups' _parent_store = True _parent_name = "parent_group" @@ -50,9 +50,7 @@ class Groups(models.AbstractModel): def add(name, field): if name not in self._fields: self._add_field(name, field) - base, model = self._name.split(".") add('parent_group', fields.Many2one( - _module=base, comodel_name=self._name, string='Parent Group', ondelete='cascade', @@ -60,13 +58,11 @@ class Groups(models.AbstractModel): index=True, automatic=True)) add('child_groups', fields.One2many( - _module=base, comodel_name=self._name, inverse_name='parent_group', string='Child Groups', automatic=True)) add('groups', fields.Many2many( - _module=base, comodel_name='res.groups', relation='%s_groups_rel' % (self._table), column1='gid', @@ -74,7 +70,6 @@ class Groups(models.AbstractModel): string='Groups', automatic=True)) add('explicit_users', fields.Many2many( - _module=base, comodel_name='res.users', relation='%s_explicit_users_rel' % (self._table), column1='gid', @@ -82,7 +77,6 @@ class Groups(models.AbstractModel): string='Explicit Users', automatic=True)) add('users', fields.Many2many( - _module=base, comodel_name='res.users', relation='%s_users_rel' % (self._table), column1='gid', @@ -100,7 +94,7 @@ class Groups(models.AbstractModel): # Read, View #---------------------------------------------------------- - @api.depends('parent_group.users', 'groups', 'groups.users', 'explicit_users') + @api.depends('parent_group', 'parent_group.users', 'groups', 'groups.users', 'explicit_users') def _compute_users(self): print(self) for record in self: diff --git a/muk_utils/views/groups.xml b/muk_utils/views/mixins_groups.xml similarity index 91% rename from muk_utils/views/groups.xml rename to muk_utils/views/mixins_groups.xml index 5a66c06..94e33da 100644 --- a/muk_utils/views/groups.xml +++ b/muk_utils/views/mixins_groups.xml @@ -20,8 +20,8 @@ - muk_utils_groups.tree - muk_utils.groups + muk_utils_mixins_groups.tree + muk_utils.mixins.groups @@ -31,8 +31,8 @@ - muk_utils_groups.form - muk_utils.groups + muk_utils_mixins_groups.form + muk_utils.mixins.groups