Starting from now, subtypes can be internal. This means that only employees (group_user members) can see the messages with this subtype. This feature replaces and enhances the 'log a note = no subtype = internal only' feature. Public and portal users cannot see internal messages. This allows to have subtypes and a follow mechanism that works for employees and is not visible for external people. Its first use will be for Crm Activities, allowing to have custom subtypes visible only for salesman and not send to the customer.
62 lines
3.3 KiB
XML
62 lines
3.3 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<openerp>
|
|
<data noupdate="1">
|
|
|
|
<!-- RULES -->
|
|
<record id="mail_group_public_and_joined" model="ir.rule">
|
|
<field name="name">Mail.group: access only public and joined groups</field>
|
|
<field name="model_id" ref="model_mail_group"/>
|
|
<!-- This rule has to be improved for employee only groups -->
|
|
<field name="domain_force">['|', '|', ('public', '=', 'public'), ('message_follower_ids', 'in', [user.partner_id.id]), '&', ('public','=','groups'), ('group_public_id','in', [g.id for g in user.groups_id])]</field>
|
|
<field name="perm_create" eval="False"/>
|
|
</record>
|
|
|
|
<record id="mail_followers_read_write_own" model="ir.rule">
|
|
<field name="name">mail.followers: read and write its own entries</field>
|
|
<field name="model_id" ref="model_mail_followers"/>
|
|
<field name="groups" eval="[(4, ref('base.group_user'))]"/>
|
|
<field name="domain_force">[('partner_id', '=', user.partner_id.id)]</field>
|
|
<field name="perm_create" eval="False"/>
|
|
<field name="perm_unlink" eval="False"/>
|
|
</record>
|
|
|
|
<!-- If technical rights then read and write others subscriptions -->
|
|
<record id="mail_followers_read_write_others" model="ir.rule">
|
|
<field name="name">mail.followers: read and write others entries</field>
|
|
<field name="model_id" ref="model_mail_followers"/>
|
|
<field name="groups" eval="[(4, ref('base.group_no_one'))]"/>
|
|
<field name="domain_force">[]</field>
|
|
<field name="perm_create" eval="False"/>
|
|
<field name="perm_unlink" eval="False"/>
|
|
</record>
|
|
|
|
<record id="mail_notification_read_write_own" model="ir.rule">
|
|
<field name="name">mail.notification: read and write its own entries</field>
|
|
<field name="model_id" ref="model_mail_notification"/>
|
|
<field name="domain_force">[('partner_id', '=', user.partner_id.id)]</field>
|
|
<field name="perm_create" eval="False"/>
|
|
<field name="perm_unlink" eval="False"/>
|
|
</record>
|
|
|
|
<record id="mail_message_subtype_rule_public" model="ir.rule">
|
|
<field name="name">mail.message.subtype: portal/public: read public subtypes</field>
|
|
<field name="model_id" ref="model_mail_message_subtype"/>
|
|
<field name="domain_force">[('internal', '=', False)]</field>
|
|
<field name="groups" eval="[(4, ref('base.group_portal')), (4, ref('base.group_public'))]"/>
|
|
</record>
|
|
|
|
<!--
|
|
This rule can not be uncommented, because we have a more wide method in mail.message. When we implement a many2one_variable field, we will be able to uncomment this.
|
|
<record id="mail_message_read_partner_or_author" model="ir.rule">
|
|
<field name="name">mail.message: read if notified or author</field>
|
|
<field name="model_id" ref="model_mail_message"/>
|
|
<field name="domain_force">['|', ('partner_ids', 'in', user.partner_id.id), ('author_id', '=', user.partner_id.id)]</field>
|
|
<field name="perm_create" eval="False"/>
|
|
<field name="perm_write" eval="False"/>
|
|
<field name="perm_unlink" eval="False"/>
|
|
</record>
|
|
-->
|
|
|
|
</data>
|
|
</openerp>
|