summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorYannick Tivisse <yti@odoo.com>2018-05-04 13:17:25 +0200
committerYannick Tivisse <yti@odoo.com>2018-05-04 13:17:25 +0200
commit2f15a5fa647d55df36c9019df467802a3aa9b4e3 (patch)
treec16bf44774fc9bee5461878a8bdd2b8ec5ab0780 /addons
parentec929342ebdeee0681fd044d45c48b99853a61b8 (diff)
[IMP] base: Add support for private addresses
Purpose ======= Add the possibility to create private addresses, only accessible for a subset of users. Specification ============= - Add a new 'Private' partner type - Add a res.groups in base 'Access to Private Addresses' - Add ir.rules for the following behavior: - Every employees/internal users can read non-private addresses - Only users in group_private_addresses can access private addresses - Add in base a simplified form view for private addresses - A HR Officer is automatically granted in group_private_addresses - Use the simplified form view to open the address_home_id form on employees
Diffstat (limited to 'addons')
-rw-r--r--addons/hr/security/hr_security.xml1
-rw-r--r--addons/hr/views/hr_views.xml5
2 files changed, 5 insertions, 1 deletions
diff --git a/addons/hr/security/hr_security.xml b/addons/hr/security/hr_security.xml
index 0d4f310aa72..5b332251eff 100644
--- a/addons/hr/security/hr_security.xml
+++ b/addons/hr/security/hr_security.xml
@@ -4,6 +4,7 @@
<record id="group_hr_user" model="res.groups">
<field name="name">Officer</field>
<field name="category_id" ref="base.module_category_human_resources"/>
+ <field name="implied_ids" eval="[(4, ref('base.group_private_addresses'))]"/>
<field name="comment">The user will be able to approve document created by employees.</field>
</record>
diff --git a/addons/hr/views/hr_views.xml b/addons/hr/views/hr_views.xml
index 04cc371ab02..6011c5b1edb 100644
--- a/addons/hr/views/hr_views.xml
+++ b/addons/hr/views/hr_views.xml
@@ -86,7 +86,10 @@
</group>
<group string="Contact Information">
<field name="address_home_id"
- context="{'show_address': 1}"
+ context="{
+ 'show_address': 1,
+ 'default_type': 'private',
+ 'form_view_ref': 'base.res_partner_view_form_private'}"
options='{"always_reload": True, "highlight_first_line": True}'/>
<field name="is_address_home_a_company" invisible="1"/>
<div class="text-warning" groups="hr.group_hr_user"