trytond-electronic_mail-old/electronic_mail.xml
2015-12-02 18:35:30 +01:00

254 lines
11 KiB
XML

<?xml version="1.0"?>
<!-- This file is part electronic_mail module for Tryton.
The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. -->
<tryton>
<data>
<record model="res.group" id="group_email_admin">
<field name="name">Electronic Mail Administrator</field>
</record>
<record model="res.group" id="group_email_user">
<field name="name">Electronic Mail User</field>
</record>
<record model="res.user-res.group" id="user_admin_group_email_admin">
<field name="user" ref="res.user_admin"/>
<field name="group" ref="group_email_admin"/>
</record>
<record model="res.user-res.group" id="user_admin_group_email_user">
<field name="user" ref="res.user_admin"/>
<field name="group" ref="group_email_user"/>
</record>
<menuitem name="Emails" sequence="10"
id="menu_email_management"/>
<record model="ir.ui.menu-res.group" id="menu_email_management_group_email_user">
<field name="menu" ref="menu_email_management"/>
<field name="group" ref="group_email_user"/>
</record>
<record model="ir.ui.view" id="mailbox_view_tree">
<field name="model">electronic.mail.mailbox</field>
<field name="type">tree</field>
<field name="name">electronic_mail_mailbox_tree</field>
</record>
<record model="ir.ui.view" id="mailbox_view_form">
<field name="model">electronic.mail.mailbox</field>
<field name="type">form</field>
<field name="name">electronic_mail_mailbox_form</field>
</record>
<record model="ir.action.act_window" id="act_mailbox_form">
<field name="name">Mailboxes</field>
<field name="res_model">electronic.mail.mailbox</field>
</record>
<record model="ir.action.act_window.view" id="act_mailbox_form_view1">
<field name="sequence" eval="10"/>
<field name="view" ref="mailbox_view_tree"/>
<field name="act_window" ref="act_mailbox_form"/>
</record>
<record model="ir.action.act_window.view" id="act_mailbox_form_view2">
<field name="sequence" eval="20"/>
<field name="view" ref="mailbox_view_form"/>
<field name="act_window" ref="act_mailbox_form"/>
</record>
<menuitem id="menu_mailbox" action="act_mailbox_form"
parent="menu_email_management"/>
<record model="ir.ui.menu-res.group"
id="menu_mailbox_group_email_admin">
<field name="menu" ref="menu_mailbox"/>
<field name="group" ref="group_email_admin"/>
</record>
<record model="ir.ui.view" id="mail_view_tree">
<field name="model">electronic.mail</field>
<field name="type">tree</field>
<field name="name">electronic_mail_tree</field>
</record>
<record model="ir.ui.view" id="mail_view_form">
<field name="model">electronic.mail</field>
<field name="type">form</field>
<field name="name">electronic_mail_form</field>
</record>
<record model="ir.action.act_window" id="act_mail_form">
<field name="name">Emails</field>
<field name="res_model">electronic.mail</field>
</record>
<record model="ir.action.act_window.view" id="act_mail_form_view1">
<field name="sequence" eval="10"/>
<field name="view" ref="mail_view_tree"/>
<field name="act_window" ref="act_mail_form"/>
</record>
<record model="ir.action.act_window.view" id="act_mail_form_view2">
<field name="sequence" eval="20"/>
<field name="view" ref="mail_view_form"/>
<field name="act_window" ref="act_mail_form"/>
</record>
<menuitem id="menu_mail" action="act_mail_form" parent="menu_email_management"/>
<!-- Access Rule Mailbox -->
<record model="ir.model.access" id="access_mailbox_admin">
<field name="model" search="[('model', '=', 'electronic.mail.mailbox')]"/>
<field name="group" ref="group_email_admin"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_create" eval="True"/>
<field name="perm_delete" eval="True"/>
</record>
<record model="ir.model.access" id="access_mailbox_user">
<field name="model" search="[('model', '=', 'electronic.mail.mailbox')]"/>
<field name="group" ref="group_email_user"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="False"/>
<field name="perm_create" eval="False"/>
<field name="perm_delete" eval="False"/>
</record>
<record model="ir.model.access" id="access_mailbox">
<field name="model" search="[('model', '=', 'electronic.mail.mailbox')]"/>
<field name="perm_read" eval="False"/>
<field name="perm_write" eval="False"/>
<field name="perm_create" eval="False"/>
<field name="perm_delete" eval="False"/>
</record>
<!-- Access Rule E-Mail -->
<record model="ir.model.access" id="access_mail_admin">
<field name="model" search="[('model', '=', 'electronic.mail')]"/>
<field name="group" ref="group_email_admin"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_create" eval="True"/>
<field name="perm_delete" eval="True"/>
</record>
<record model="ir.model.access" id="access_mail_user">
<field name="model" search="[('model', '=', 'electronic.mail')]"/>
<field name="group" ref="group_email_user"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_create" eval="True"/>
<field name="perm_delete" eval="True"/>
</record>
<record model="ir.model.access" id="access_mail">
<field name="model" search="[('model', '=', 'electronic.mail')]"/>
<field name="perm_read" eval="False"/>
<field name="perm_write" eval="False"/>
<field name="perm_create" eval="False"/>
<field name="perm_delete" eval="False"/>
</record>
<!-- Rule to read mailboxes -->
<record model="ir.rule.group" id="rule_group_read_mailbox">
<field name="model" search="[('model', '=', 'electronic.mail.mailbox')]"/>
<field name="global_p" eval="True"/>
<field name="default_p" eval="False"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="False"/>
<field name="perm_create" eval="False"/>
<field name="perm_delete" eval="False"/>
</record>
<!--
<record model="ir.rule" id="rule_group_read_mailbox_line1">
<field name="field"
search="[('name', '=', 'user'), ('model.model', '=', 'electronic.mail.mailbox')]"/>
<field name="operator">=</field>
<field name="operand">User</field>
<field name="rule_group" ref="rule_group_read_mailbox"/>
</record>
<record model="ir.rule" id="rule_group_read_mailbox_line2">
<field name="field"
search="[('name', '=', 'read_users'), ('model.model', '=', 'electronic.mail.mailbox')]"/>
<field name="operator">=</field>
<field name="operand">User</field>
<field name="rule_group" ref="rule_group_read_mailbox"/>
</record>
<record model="ir.rule" id="rule_group_read_mailbox_line3">
<field name="field"
search="[('name', '=', 'write_users'), ('model.model', '=', 'electronic.mail.mailbox')]"/>
<field name="operator">=</field>
<field name="operand">User</field>
<field name="rule_group" ref="rule_group_read_mailbox"/>
</record>
<record model="ir.rule" id="rule_group_read_mailbox_line4">
<field name="field"
search="[('name', '=', 'create_uid'), ('model.model', '=', 'electronic.mail.mailbox')]"/>
<field name="operator">=</field>
<field name="operand">User</field>
<field name="rule_group" ref="rule_group_read_mailbox"/>
</record>
-->
<!-- Rule to read emails -->
<record model="ir.rule.group" id="rule_group_read_mail">
<field name="model" search="[('model', '=', 'electronic.mail')]"/>
<field name="global_p" eval="True"/>
<field name="default_p" eval="False"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="False"/>
<field name="perm_create" eval="False"/>
<field name="perm_delete" eval="False"/>
</record>
<!--
<record model="ir.rule" id="rule_group_read_mail_line1">
<field name="field"
search="[('name', '=', 'mailbox_owner'), ('model.model', '=', 'electronic.mail')]"/>
<field name="operator">=</field>
<field name="operand">User</field>
<field name="rule_group" ref="rule_group_read_mail"/>
</record>
<record model="ir.rule" id="rule_group_read_mail_line2">
<field name="field"
search="[('name', '=', 'mailbox_read_users'), ('model.model', '=', 'electronic.mail')]"/>
<field name="operator">=</field>
<field name="operand">User</field>
<field name="rule_group" ref="rule_group_read_mail"/>
</record>
<record model="ir.rule" id="rule_group_read_mail_line3">
<field name="field"
search="[('name', '=', 'mailbox_write_users'), ('model.model', '=', 'electronic.mail')]"/>
<field name="operator">=</field>
<field name="operand">User</field>
<field name="rule_group" ref="rule_group_read_mail"/>
</record>
-->
<!-- Rule to write emails -->
<record model="ir.rule.group" id="rule_group_write_mail">
<field name="model" search="[('model', '=', 'electronic.mail')]"/>
<field name="global_p" eval="True"/>
<field name="default_p" eval="False"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_create" eval="True"/>
<field name="perm_delete" eval="True"/>
</record>
<!--
<record model="ir.rule" id="rule_group_write_mail_line1">
<field name="field"
search="[('name', '=', 'mailbox_owner'), ('model.model', '=', 'electronic.mail')]"/>
<field name="operator">=</field>
<field name="operand">User</field>
<field name="rule_group" ref="rule_group_write_mail"/>
</record>
<record model="ir.rule" id="rule_group_write_mailbox_line2">
<field name="field"
search="[('name', '=', 'mailbox_write_users'), ('model.model', '=', 'electronic.mail')]"/>
<field name="operator">=</field>
<field name="operand">User</field>
<field name="rule_group" ref="rule_group_write_mail"/>
</record>
-->
<record model="ir.cron" id="cron_send_emails">
<field name="name">Send eMails</field>
<field name="request_user" ref="res.user_admin"/>
<field name="user" ref="res.user_trigger"/>
<field name="active" eval="True"/>
<field name="interval_number" eval="1"/>
<field name="interval_type">hours</field>
<field name="number_calls" eval="-1"/>
<field name="repeat_missed" eval="False"/>
<field name="model">electronic.mail</field>
<field name="function">send_emails_scheduler</field>
</record>
</data>
</tryton>