Simone Orsi
7 years ago
committed by
Holger Brunn
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
-
18mail_digest/views/mail_digest_views.xml
-
7mail_digest/views/partner_views.xml
-
45mail_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 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 |
|||
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,18 +1,41 @@ |
|||
<?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> |
|||
<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"> |
|||
<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> |
|||
<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> |
|||
|
|||
</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