Files
odoo_source/addons/maintenance/security/maintenance.xml
T
Martin Trigaux 11812b0b9e [FIX] all: remove external ids fakely from base
Several modules defines records with the external ID `base.foo_bar` while it is
created inside this module (typically menus and groups).
While there is no technical reasons to do so but this may introduce issues:

- these records will not be deleted during uninstall
- if a language is loaded before the installation of the module, it won't be
  translated

The uninstallation will only remove the records with an external id linked to
this module (these would only be removed when removing base).

Installing a language before the module will drop the translations not linked
to an existing external id (as it can not be resolved).

This commit correct all the external ids tagged as from base or other incorrect
modules.
2016-09-02 16:14:26 +02:00

41 lines
2.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- This group is only allowed to deal with equipment registration and maintenance -->
<record id="group_equipment_manager" model="res.groups">
<field name="name">Equipment Manager</field>
<field name="category_id" ref="base.module_category_human_resources"/>
<field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
<field name="comment">The user will be able to manage equipments.</field>
</record>
<!-- Rules -->
<record id="equipment_request_rule_user" model="ir.rule">
<field name="name">Users are allowed to access their own maintenance requests</field>
<field name="model_id" ref="model_maintenance_request"/>
<field name="domain_force">['|', ('owner_user_id.id', '=', user.id), ('technician_user_id.id', '=', user.id)]</field>
<field name="groups" eval="[(4, ref('base.group_user'))]"/>
</record>
<record id="equipment_rule_user" model="ir.rule">
<field name="name">Users are allowed to access their own equipments</field>
<field name="model_id" ref="model_maintenance_equipment"/>
<field name="domain_force">[('owner_user_id.id', '=', user.id)]</field>
<field name="groups" eval="[(4, ref('base.group_user'))]"/>
</record>
<record id="equipment_request_rule_admin_user" model="ir.rule">
<field name="name">Administrator of maintenance requests</field>
<field name="model_id" ref="model_maintenance_request"/>
<field name="domain_force">[(1, '=', 1)]</field>
<field name="groups" eval="[(4, ref('group_equipment_manager'))]"/>
</record>
<record id="equipment_rule_admin_user" model="ir.rule">
<field name="name">Equipments administrator</field>
<field name="model_id" ref="model_maintenance_equipment"/>
<field name="domain_force">[(1, '=', 1)]</field>
<field name="groups" eval="[(4, ref('group_equipment_manager'))]"/>
</record>
</odoo>