Simone Orsi
8 years ago
87 changed files with 2302 additions and 563 deletions
-
11mail_digest/README.rst
-
4mail_digest/__manifest__.py
-
9mail_digest/data/config_param.xml
-
29mail_digest/i18n/am.po
-
32mail_digest/i18n/ar.po
-
29mail_digest/i18n/bg.po
-
32mail_digest/i18n/bs.po
-
29mail_digest/i18n/ca.po
-
32mail_digest/i18n/ca_ES.po
-
29mail_digest/i18n/cs.po
-
29mail_digest/i18n/da.po
-
30mail_digest/i18n/de.po
-
32mail_digest/i18n/el_GR.po
-
32mail_digest/i18n/en_GB.po
-
29mail_digest/i18n/es.po
-
32mail_digest/i18n/es_AR.po
-
32mail_digest/i18n/es_CL.po
-
32mail_digest/i18n/es_CO.po
-
32mail_digest/i18n/es_CR.po
-
32mail_digest/i18n/es_DO.po
-
32mail_digest/i18n/es_EC.po
-
32mail_digest/i18n/es_ES.po
-
32mail_digest/i18n/es_MX.po
-
32mail_digest/i18n/es_PE.po
-
32mail_digest/i18n/es_PY.po
-
32mail_digest/i18n/es_VE.po
-
29mail_digest/i18n/et.po
-
29mail_digest/i18n/eu.po
-
29mail_digest/i18n/fa.po
-
29mail_digest/i18n/fi.po
-
57mail_digest/i18n/fr.po
-
32mail_digest/i18n/fr_CA.po
-
76mail_digest/i18n/fr_CH.po
-
29mail_digest/i18n/gl.po
-
32mail_digest/i18n/gl_ES.po
-
29mail_digest/i18n/he.po
-
35mail_digest/i18n/hr.po
-
35mail_digest/i18n/hr_HR.po
-
29mail_digest/i18n/hu.po
-
29mail_digest/i18n/id.po
-
64mail_digest/i18n/it.po
-
29mail_digest/i18n/ja.po
-
29mail_digest/i18n/ko.po
-
32mail_digest/i18n/lt.po
-
35mail_digest/i18n/lt_LT.po
-
32mail_digest/i18n/lv.po
-
32mail_digest/i18n/mail_digest.pot
-
29mail_digest/i18n/mk.po
-
29mail_digest/i18n/mn.po
-
32mail_digest/i18n/nb.po
-
32mail_digest/i18n/nb_NO.po
-
29mail_digest/i18n/nl.po
-
32mail_digest/i18n/nl_BE.po
-
32mail_digest/i18n/nl_NL.po
-
33mail_digest/i18n/pl.po
-
29mail_digest/i18n/pt.po
-
32mail_digest/i18n/pt_BR.po
-
32mail_digest/i18n/pt_PT.po
-
32mail_digest/i18n/ro.po
-
33mail_digest/i18n/ru.po
-
29mail_digest/i18n/sk.po
-
32mail_digest/i18n/sl.po
-
32mail_digest/i18n/sr.po
-
35mail_digest/i18n/sr@latin.po
-
29mail_digest/i18n/sv.po
-
29mail_digest/i18n/th.po
-
29mail_digest/i18n/tr.po
-
32mail_digest/i18n/tr_TR.po
-
32mail_digest/i18n/uk.po
-
29mail_digest/i18n/vi.po
-
32mail_digest/i18n/vi_VN.po
-
32mail_digest/i18n/zh_CN.po
-
32mail_digest/i18n/zh_TW.po
-
BINmail_digest/images/preview.png
-
1mail_digest/models/__init__.py
-
89mail_digest/models/mail_digest.py
-
31mail_digest/models/res_partner.py
-
28mail_digest/models/res_users.py
-
7mail_digest/security/ir.model.access.csv
-
14mail_digest/security/record_rules.xml
-
4mail_digest/templates/digest_default.xml
-
47mail_digest/tests/test_digest.py
-
2mail_digest/tests/test_partner_domains.py
-
2mail_digest/tests/test_subtypes_conf.py
-
76mail_digest/views/mail_digest_views.xml
-
71mail_digest/views/partner_views.xml
-
53mail_digest/views/user_views.xml
@ -0,0 +1,9 @@ |
|||||
|
<odoo> |
||||
|
<data noupdate="1"> |
||||
|
<record id="mail_digest_enabled_message_types" model="ir.config_parameter"> |
||||
|
<field name="key">mail_digest.enabled_message_types</field> |
||||
|
<!-- enabled by default for each message type --> |
||||
|
<field name="value">email,notification,comment</field> |
||||
|
</record> |
||||
|
</data> |
||||
|
</odoo> |
Before Width: 837 | Height: 253 | Size: 20 KiB After Width: 943 | Height: 224 | Size: 20 KiB |
@ -1,2 +1,3 @@ |
|||||
from . import mail_digest |
from . import mail_digest |
||||
from . import res_partner |
from . import res_partner |
||||
|
from . import res_users |
@ -0,0 +1,28 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
# Copyright 2017 Simone Orsi <simone.orsi@camptocamp.com> |
||||
|
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). |
||||
|
|
||||
|
from odoo import models |
||||
|
|
||||
|
|
||||
|
class Users(models.Model): |
||||
|
_name = 'res.users' |
||||
|
_inherit = ['res.users'] |
||||
|
|
||||
|
def __init__(self, pool, cr): |
||||
|
""" Override of __init__ to add access rights. |
||||
|
|
||||
|
Access rights are disabled by default, but allowed |
||||
|
on some specific fields defined in self.SELF_{READ/WRITE}ABLE_FIELDS. |
||||
|
|
||||
|
[copied from mail.models.users] |
||||
|
""" |
||||
|
super(Users, self).__init__(pool, cr) |
||||
|
# duplicate list to avoid modifying the original reference |
||||
|
type(self).SELF_WRITEABLE_FIELDS = list(self.SELF_WRITEABLE_FIELDS) |
||||
|
type(self).SELF_WRITEABLE_FIELDS.extend(['notify_frequency']) |
||||
|
type(self).SELF_WRITEABLE_FIELDS.extend(['notify_conf_ids']) |
||||
|
# duplicate list to avoid modifying the original reference |
||||
|
type(self).SELF_READABLE_FIELDS = list(self.SELF_READABLE_FIELDS) |
||||
|
type(self).SELF_READABLE_FIELDS.extend(['notify_frequency']) |
||||
|
type(self).SELF_READABLE_FIELDS.extend(['notify_conf_ids']) |
@ -1,5 +1,4 @@ |
|||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink |
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink |
||||
access_mail_digest_all,mail.digest.all,model_mail_digest,,1,0,0,0 |
|
||||
access_partner_notification_conf_all,partner.notification.all,model_partner_notification_conf,,1,0,0,0 |
|
||||
access_mail_digest_system,mail.digest.all,model_mail_digest,base.group_system,1,1,1,1 |
|
||||
access_partner_notification_conf_system,partner.notification.all,model_partner_notification_conf,base.group_system,1,1,1,1 |
|
||||
|
access_partner_notification_conf_user,partner.notification.user,model_partner_notification_conf,base.group_user,1,1,1,1 |
||||
|
access_mail_digest_system,mail.digest.sys,model_mail_digest,base.group_system,1,1,1,1 |
||||
|
access_partner_notification_conf_system,partner.notification.sys,model_partner_notification_conf,base.group_system,1,1,1,1 |
@ -0,0 +1,14 @@ |
|||||
|
<?xml version="1.0"?> |
||||
|
<odoo> |
||||
|
|
||||
|
<record model="ir.rule" id="partner_notification_conf_owner"> |
||||
|
<field name="name">Partners can edit their own notification settings</field> |
||||
|
<field name="model_id" ref="model_partner_notification_conf"/> |
||||
|
<field name="perm_read" eval="False"/> |
||||
|
<field name="perm_create" eval="False"/> |
||||
|
<field name="perm_write" eval="True"/> |
||||
|
<field name="perm_unlink" eval="True"/> |
||||
|
<field name="domain_force">['|',('partner_id', '=', user.partner_id.id), ('create_uid', '=', user.id)]</field> |
||||
|
</record> |
||||
|
|
||||
|
</odoo> |
@ -1,50 +1,58 @@ |
|||||
<?xml version="1.0"?> |
<?xml version="1.0"?> |
||||
<openerp> |
|
||||
<data> |
|
||||
|
<odoo> |
||||
|
|
||||
<record model="ir.ui.view" id="mail_digest_tree"> |
|
||||
<field name="name">mail_digest mail.digest.tree</field> |
|
||||
<field name="model">mail.digest</field> |
|
||||
<field name="arch" type="xml"> |
|
||||
<tree string="Mail digest"> |
|
||||
<field name="partner_id" /> |
|
||||
<field name="mail_id" /> |
|
||||
<field name="state" /> |
|
||||
</tree> |
|
||||
</field> |
|
||||
</record> |
|
||||
|
<record model="ir.ui.view" id="mail_digest_tree"> |
||||
|
<field name="name">mail_digest mail.digest.tree</field> |
||||
|
<field name="model">mail.digest</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<tree string="Mail digest"> |
||||
|
<field name="partner_id" /> |
||||
|
<field name="mail_id" /> |
||||
|
<field name="state" /> |
||||
|
</tree> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
|
||||
<record model="ir.ui.view" id="mail_digest_form"> |
|
||||
<field name="name">mail_digest mail.digest.form</field> |
|
||||
<field name="model">mail.digest</field> |
|
||||
<field name="arch" type="xml"> |
|
||||
<form string="Mail digest"> |
|
||||
<group name="main" col="4"> |
|
||||
|
<record model="ir.ui.view" id="mail_digest_form"> |
||||
|
<field name="name">mail_digest mail.digest.form</field> |
||||
|
<field name="model">mail.digest</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<form string="Mail digest"> |
||||
|
<sheet> |
||||
|
<div class="oe_button_box" name="button_box"> |
||||
|
<button name="action_create_email" icon="fa-envelope" |
||||
|
string="Create email now" |
||||
|
type="object" attrs="{'invisible': [('mail_id', '!=', False)]}" /> |
||||
|
</div> |
||||
|
<group name="main" col="2"> |
||||
<field name="name" /> |
<field name="name" /> |
||||
<field name="partner_id" /> |
<field name="partner_id" /> |
||||
|
</group> |
||||
|
<group name="settings" col="2"> |
||||
<field name="frequency" /> |
<field name="frequency" /> |
||||
<field name="mail_id" /> |
<field name="mail_id" /> |
||||
<field name="state" /> |
<field name="state" /> |
||||
|
<field name="template_id" /> |
||||
</group> |
</group> |
||||
<group name="messages" string="Messages" col="4"> |
<group name="messages" string="Messages" col="4"> |
||||
<field name="message_ids" nolabel="1" /> |
<field name="message_ids" nolabel="1" /> |
||||
</group> |
</group> |
||||
</form> |
|
||||
</field> |
|
||||
</record> |
|
||||
|
</sheet> |
||||
|
</form> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
<record model="ir.actions.act_window" id="action_digest_all"> |
|
||||
<field name="name">Digest</field> |
|
||||
<field name="res_model">mail.digest</field> |
|
||||
<field name="view_type">form</field> |
|
||||
<field name="view_mode">form,tree</field> |
|
||||
<field name="view_id" ref="mail_digest_tree" /> |
|
||||
</record> |
|
||||
|
<record model="ir.actions.act_window" id="action_digest_all"> |
||||
|
<field name="name">Digest</field> |
||||
|
<field name="res_model">mail.digest</field> |
||||
|
<field name="view_type">form</field> |
||||
|
<field name="view_mode">form,tree</field> |
||||
|
<field name="view_id" ref="mail_digest_tree" /> |
||||
|
</record> |
||||
|
|
||||
<menuitem id="menu_email_digest" parent="base.menu_email" |
|
||||
action="action_digest_all" |
|
||||
sequence="90"/> |
|
||||
|
<menuitem id="menu_email_digest" parent="base.menu_email" |
||||
|
action="action_digest_all" |
||||
|
sequence="90"/> |
||||
|
|
||||
</data> |
|
||||
</openerp> |
|
||||
|
</odoo> |
@ -1,41 +1,38 @@ |
|||||
<?xml version="1.0"?> |
<?xml version="1.0"?> |
||||
<openerp> |
|
||||
<data> |
|
||||
|
<odoo> |
||||
|
<record id="notifications_emails_partner_info_form" model="ir.ui.view"> |
||||
|
<field name="name">mail.notifications res.partner.form</field> |
||||
|
<field name="model">res.partner</field> |
||||
|
<field name="inherit_id" ref="mail.view_emails_partner_info_form"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<xpath expr="//field[@name='notify_email']" position="after"> |
||||
|
<field name="notify_conf_ids" attrs="{'invisible': [('notify_email','=', 'none')]}"/> |
||||
|
</xpath> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
<record id="notifications_emails_partner_info_form" model="ir.ui.view"> |
|
||||
<field name="name">mail.notifications res.partner.form</field> |
|
||||
<field name="model">res.partner</field> |
|
||||
<field name="inherit_id" ref="mail.view_emails_partner_info_form"/> |
|
||||
<field name="arch" type="xml"> |
|
||||
<xpath expr="//field[@name='notify_email']" position="after"> |
|
||||
<field name="notify_conf_ids" attrs="{'invisible': [('notify_email','=', 'none')]}"/> |
|
||||
</xpath> |
|
||||
</field> |
|
||||
</record> |
|
||||
|
|
||||
<record model="ir.ui.view" id="notification_form"> |
|
||||
<field name="name">partner.notification.conf form</field> |
|
||||
<field name="model">partner.notification.conf</field> |
|
||||
<field name="arch" type="xml"> |
|
||||
<form string="Notification"> |
|
||||
<group name="main"> |
|
||||
<field name="enabled" /> |
|
||||
<field name="subtype_id" options="{'no_create': True}" /> |
|
||||
</group> |
|
||||
</form> |
|
||||
</field> |
|
||||
</record> |
|
||||
|
|
||||
<record model="ir.ui.view" id="notification_tree"> |
|
||||
<field name="name">partner.notification.conf tree</field> |
|
||||
<field name="model">partner.notification.conf</field> |
|
||||
<field name="arch" type="xml"> |
|
||||
<tree string="Notifications" editable="top"> |
|
||||
|
<record model="ir.ui.view" id="notification_form"> |
||||
|
<field name="name">partner.notification.conf form</field> |
||||
|
<field name="model">partner.notification.conf</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<form string="Notification"> |
||||
|
<group name="main"> |
||||
<field name="enabled" /> |
<field name="enabled" /> |
||||
<field name="subtype_id" /> |
|
||||
</tree> |
|
||||
</field> |
|
||||
</record> |
|
||||
|
<field name="subtype_id" options="{'no_create': True}" /> |
||||
|
</group> |
||||
|
</form> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record model="ir.ui.view" id="notification_tree"> |
||||
|
<field name="name">partner.notification.conf tree</field> |
||||
|
<field name="model">partner.notification.conf</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<tree string="Notifications" editable="top"> |
||||
|
<field name="enabled" /> |
||||
|
<field name="subtype_id" /> |
||||
|
</tree> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
</data> |
|
||||
</openerp> |
|
||||
|
</odoo> |
@ -1,18 +1,41 @@ |
|||||
<?xml version="1.0"?> |
<?xml version="1.0"?> |
||||
<openerp> |
|
||||
<data> |
|
||||
|
|
||||
<record id="notifications_email_user_info_form" model="ir.ui.view"> |
|
||||
<field name="name">mail.notifications res.users.form</field> |
|
||||
<field name="model">res.users</field> |
|
||||
<field name="inherit_id" ref="mail.view_users_form_mail"/> |
|
||||
<field name="arch" type="xml"> |
|
||||
<xpath expr="//field[@name='notify_email']" position="after"> |
|
||||
<field name="notify_frequency" attrs="{'invisible': [('notify_email','=', 'none')]}" /> |
|
||||
<field name="notify_conf_ids" attrs="{'invisible': [('notify_email','=', 'none')]}" /> |
|
||||
</xpath> |
|
||||
|
<odoo> |
||||
|
<record id="view_users_form_mail" model="ir.ui.view"> |
||||
|
<field name="name">mail_digest res.users notification settings</field> |
||||
|
<field name="model">res.users</field> |
||||
|
<field name="inherit_id" ref="mail.view_users_form_mail"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<field name="notify_email" position="replace"> |
||||
|
<group name="notif_left"> |
||||
|
<field name="notify_email" widget="radio" readonly="0"/> |
||||
|
<field name="notify_frequency" readonly="0" |
||||
|
attrs="{'invisible': [('notify_email', '!=', 'digest')]}" /> |
||||
|
</group> |
||||
|
<group name="notif_right" attrs="{'invisible': [('notify_email','=', 'none')]}"> |
||||
|
<label string="Enable/disable notifications by type" colspan="4" /> |
||||
|
<field name="notify_conf_ids" nolabel="1" colspan="4" readonly="0" /> |
||||
|
</group> |
||||
</field> |
</field> |
||||
</record> |
|
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
|
||||
</data> |
|
||||
</openerp> |
|
||||
|
<record id="view_users_form_simple_modif_mail" model="ir.ui.view"> |
||||
|
<field name="name">mail_digest res.users notification preferences</field> |
||||
|
<field name="model">res.users</field> |
||||
|
<field name="inherit_id" ref="mail.view_users_form_simple_modif_mail"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<field name="notify_email" position="replace"> |
||||
|
<group name="notif_left"> |
||||
|
<field name="notify_email" widget="radio" readonly="0"/> |
||||
|
<field name="notify_frequency" readonly="0" |
||||
|
attrs="{'invisible': [('notify_email', '!=', 'digest')]}" /> |
||||
|
</group> |
||||
|
<group name="notif_right" attrs="{'invisible': [('notify_email','=', 'none')]}"> |
||||
|
<label string="Enable/disable notifications by type" colspan="4" /> |
||||
|
<field name="notify_conf_ids" nolabel="1" colspan="4" readonly="0" /> |
||||
|
</group> |
||||
|
</field> |
||||
|
</field> |
||||
|
</record> |
||||
|
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue