[FIX] mail, share: correct module update.

a6eac0f08e introduced a new `res.groups`
belonging to the "Sharing" category.
As this group has the flag `shared`, it is ignore when generating the
group's user view (and its virtual fields).

When updating `mail` module, the `share` module (which depend on mail)
is not loaded yet. This mean this new group is taken into account when
getting the `res.users` virtual fields.
As this group belong to the same category as the `share.group_share_user`
group but dont have an inheritance link between them (`implied_ids`),
they are generated as `boolean` instead of a single entry `selection`
field. This create a missmatch between the fields and the previously
generated view, which forbid inheritance application.

Force view regeneration, to avoid it.

Also change the group's category as this group is purely technical and
must be hidden anyway.
This commit is contained in:
Christophe Simonis 2015-03-17 19:29:54 +01:00
parent 082a6ce0ab
commit 98c1a82e68
2 changed files with 13 additions and 1 deletions

View File

@ -16,6 +16,18 @@
</field>
</record>
<!-- Force update of groups' user view.
When updating (not new install), as `share` module is not loaded yet, shared groups
are taken into account when getting the group list, resulting to a different
organisation of the `Sharing` category (booleans instead of a selection) and thus,
different virtual field names.
When applying then inheritance of the following view, the check of field names
failed due to these virtual field name missmatch.
This is only for databases updated between a6eac0f08ee9100d1a44a4068d4f580b1c7c4b2c
and the commit introducing this line.
-->
<function model="res.groups" name="update_user_groups_view" />
<!-- Update user form !-->
<record id="view_users_form_mail" model="ir.ui.view">
<field name="name">res.users.form.mail</field>

View File

@ -19,7 +19,7 @@ Members of this groups have access to the sharing wizard, which allows them to i
<field name="name">Shared Group</field>
<field name="comment">
This group is a template group for shared users, giving basic access needs, the menus for instance.</field>
<field name="category_id" ref="module_category_share"/>
<field name="category_id" ref="base.module_category_hidden"/>
<field name="share">1</field>
</record>
</data>