Browse Source

publish muk_utils - 12.0

pull/9/head
MuK IT GmbH 6 years ago
parent
commit
f5745de88e
  1. 5
      muk_utils/models/mixins_groups.py
  2. 4
      muk_utils/views/mixins_groups.xml

5
muk_utils/models/mixins_groups.py

@ -51,6 +51,7 @@ class Groups(models.AbstractModel):
if name not in self._fields: if name not in self._fields:
self._add_field(name, field) self._add_field(name, field)
add('parent_group', fields.Many2one( add('parent_group', fields.Many2one(
_module=self._module,
comodel_name=self._name, comodel_name=self._name,
string='Parent Group', string='Parent Group',
ondelete='cascade', ondelete='cascade',
@ -58,11 +59,13 @@ class Groups(models.AbstractModel):
index=True, index=True,
automatic=True)) automatic=True))
add('child_groups', fields.One2many( add('child_groups', fields.One2many(
_module=self._module,
comodel_name=self._name, comodel_name=self._name,
inverse_name='parent_group', inverse_name='parent_group',
string='Child Groups', string='Child Groups',
automatic=True)) automatic=True))
add('groups', fields.Many2many( add('groups', fields.Many2many(
_module=self._module,
comodel_name='res.groups', comodel_name='res.groups',
relation='%s_groups_rel' % (self._table), relation='%s_groups_rel' % (self._table),
column1='gid', column1='gid',
@ -70,6 +73,7 @@ class Groups(models.AbstractModel):
string='Groups', string='Groups',
automatic=True)) automatic=True))
add('explicit_users', fields.Many2many( add('explicit_users', fields.Many2many(
_module=self._module,
comodel_name='res.users', comodel_name='res.users',
relation='%s_explicit_users_rel' % (self._table), relation='%s_explicit_users_rel' % (self._table),
column1='gid', column1='gid',
@ -77,6 +81,7 @@ class Groups(models.AbstractModel):
string='Explicit Users', string='Explicit Users',
automatic=True)) automatic=True))
add('users', fields.Many2many( add('users', fields.Many2many(
_module=self._module,
comodel_name='res.users', comodel_name='res.users',
relation='%s_users_rel' % (self._table), relation='%s_users_rel' % (self._table),
column1='gid', column1='gid',

4
muk_utils/views/mixins_groups.xml

@ -19,7 +19,7 @@
<odoo> <odoo>
<record id="view_groups_tree" model="ir.ui.view">
<record id="view_mixins_groups_tree" model="ir.ui.view">
<field name="name">muk_utils_mixins_groups.tree</field> <field name="name">muk_utils_mixins_groups.tree</field>
<field name="model">muk_utils.mixins.groups</field> <field name="model">muk_utils.mixins.groups</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
@ -30,7 +30,7 @@
</field> </field>
</record> </record>
<record id="view_groups_form" model="ir.ui.view">
<record id="view_mixins_groups_form" model="ir.ui.view">
<field name="name">muk_utils_mixins_groups.form</field> <field name="name">muk_utils_mixins_groups.form</field>
<field name="model">muk_utils.mixins.groups</field> <field name="model">muk_utils.mixins.groups</field>
<field name="arch" type="xml"> <field name="arch" type="xml">

Loading…
Cancel
Save