Skip to content

Commit

Permalink
[UPG] viin_brand_mail: upgrade version 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SonCrits committed Jul 17, 2024
1 parent 2df2a0a commit d2839ee
Show file tree
Hide file tree
Showing 42 changed files with 205 additions and 222 deletions.
1 change: 1 addition & 0 deletions viin_brand_mail/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from . import models
from . import wizard
28 changes: 12 additions & 16 deletions viin_brand_mail/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,32 +42,28 @@
# always loaded
'data': [
'data/res_partner_data.xml',
'data/mail_channel_data.xml',
'views/mail_data.xml',
'data/discuss_channel_data.xml',
'data/mail_templates_email_layouts.xml',
'data/mail_groups.xml',
'views/res_config_settings_views.xml',
'views/discuss_public_templates.xml',
'wizard/mail_compose_message_views.xml',
],
'demo': [
'data/mail_channel_demo.xml',
'data/discuss_channel_demo.xml',
],
'assets': {
'web.assets_backend': [
# mail branding
('after', 'mail/static/src/components/chat_window/chat_window.scss', 'viin_brand_mail/static/src/components/chat_window/chat_window.scss'),
('after', 'mail/static/src/components/chat_window_header/chat_window_header.scss', 'viin_brand_mail/static/src/components/chat_window_header/chat_window_header.scss'),
('after', 'mail/static/src/components/discuss_sidebar/discuss_sidebar.scss', 'viin_brand_mail/static/src/components/discuss_sidebar/discuss_sidebar.scss'),
('after', 'mail/static/src/components/discuss_sidebar_category_item/discuss_sidebar_category_item.scss', 'viin_brand_mail/static/src/components/discuss_sidebar_category_item/discuss_sidebar_category_item.scss'),
('after', 'mail/static/src/components/message/message.scss', 'viin_brand_mail/static/src/components/message/message.scss'),
('after', 'mail/static/src/components/message/message.xml', 'viin_brand_mail/static/src/components/message/message.xml'),
('after', 'mail/static/src/components/persona_im_status_icon/persona_im_status_icon.scss', 'viin_brand_mail/static/src/components/partner_im_status_icon/partner_im_status_icon.scss'),
('after', 'mail/static/src/components/thread_view/thread_view.scss', 'viin_brand_mail/static/src/components/thread_view/thread_view.scss'),
('after', 'mail/static/src/components/thread_icon/thread_icon.scss', 'viin_brand_mail/static/src/components/thread_icon/thread_icon.scss'),
('after', 'mail/static/src/components/chatter_topbar/chatter_topbar.scss', 'viin_brand_mail/static/src/components/chatter_topbar/chatter_topbar.scss'),
('after', 'mail/static/src/components/composer/composer.scss', 'viin_brand_mail/static/src/components/composer/composer.scss'),
('after', 'mail/static/src/components/thread_view_topbar/thread_view_topbar.scss', 'viin_brand_mail/static/src/components/thread_view_topbar/thread_view_topbar.scss'),
('after', 'mail/static/src/core/common/chat_window.scss', 'viin_brand_mail/static/src/core/common/chat_window.scss'),
('after', 'mail/static/src/core/common/core.scss', 'viin_brand_mail/static/src/core/common/core.scss'),
('after', 'mail/static/src/core/common/im_status.scss', 'viin_brand_mail/static/src/core/common/im_status.scss'),
('after', 'mail/static/src/core/web/discuss_sidebar.scss', 'viin_brand_mail/static/src/core/web/discuss_sidebar.scss'),
('after', 'mail/static/src/discuss/core/web/discuss_sidebar_categories.scss', 'viin_brand_mail/static/src/discuss/core/web/discuss_sidebar_categories.scss'),
],
},
'installable': False, # set auto_install True after upgrading for v17 after upgrading for v17
'installable': True,
'auto_install': True,
'price': 9.9,
'currency': 'EUR',
'license': 'OPL-1',
Expand Down
5 changes: 5 additions & 0 deletions viin_brand_mail/data/discuss_channel_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<odoo>
<record id="mail.module_install_notification" model="mail.message">
<field name="subject">Welcome to Viindoo!</field>
</record>
</odoo>
18 changes: 18 additions & 0 deletions viin_brand_mail/data/discuss_channel_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<odoo>
<record id="mail.mail_message_channel_whole_1" model="mail.message">
<field name="body">
<![CDATA[
<p>
Great news!<br/>
Our company has received the Deloitte Fast 50 award. We are the fastest
growing company of the country, with a growth of 1549% over the past 5
years. You can get more information <a href="https://viindoo.com/blog">on our blog</a>.
</p>
]]>
</field>
</record>

<record id="mail.mail_message_channel_1_2_1" model="mail.message">
<field name="body"><![CDATA[<p>When I have too much opportunities in the pipe, I start communicating with prospects more by email than phonecalls.</p><p>I send an email to create a sense of emergency, like <i>"can I call you this week about our quote?"</i> and I call only those that answer this email.</p><p>You can use the email template feature of Viindoo to automate email composition.</p>]]></field>
</record>
</odoo>
7 changes: 0 additions & 7 deletions viin_brand_mail/data/mail_channel_data.xml

This file was deleted.

13 changes: 0 additions & 13 deletions viin_brand_mail/data/mail_channel_demo.xml

This file was deleted.

7 changes: 7 additions & 0 deletions viin_brand_mail/data/mail_groups.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<odoo>

<record id="mail.group_mail_notification_type_inbox" model="res.groups">
<field name="name">Receive notifications in Viindoo</field>
</record>

</odoo>
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="mail_notification_light" inherit_id="mail.mail_notification_light">
<xpath expr="//a[@href='https://www.odoo.com?utm_source=db&amp;utm_medium=email']" position="replace" mode="inner">
Viindoo
</xpath>
<xpath expr="//a[@href='https://www.odoo.com?utm_source=db&amp;utm_medium=email']" position="attributes">
<attribute name="style">color: #66C8D3;</attribute>
<attribute name="href">https://viindoo.com?utm_source=db&amp;utm_medium=email</attribute>
<attribute name="href">https://viindoo.com?utm_source=db&amp;utm_medium=email</attribute>
<attribute name="t-att-style">'color: ' + (company.email_secondary_color or '#66C8D3') + ';'</attribute>
</xpath>
</template>
<template id="mail_notification_layout" inherit_id="mail.mail_notification_layout">
<xpath expr="//a[@href='https://www.odoo.com?utm_source=db&amp;utm_medium=email']" position="replace" mode="inner">
Viindoo
Viindoo
</xpath>
<xpath expr="//a[@href='https://www.odoo.com?utm_source=db&amp;utm_medium=email']" position="attributes">
<attribute name="style">color: #66C8D3;</attribute>
<attribute name="href">https://viindoo.com?utm_source=db&amp;utm_medium=email</attribute>
<attribute name="href">https://viindoo.com?utm_source=db&amp;utm_medium=email</attribute>
<attribute name="t-att-style">'color: ' + (company.email_secondary_color or '#66C8D3') + ';'</attribute>
</xpath>
</template>
</odoo>
1 change: 0 additions & 1 deletion viin_brand_mail/data/res_partner_data.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="base.partner_root" model="res.partner">
<field name="name">ViindooBot</field>
Expand Down
7 changes: 7 additions & 0 deletions viin_brand_mail/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
from . import ir_http
from . import mail_alias_domain
from . import mail_alias
from . import mail_gateway_allowed
from . import mail_mail
from . import mail_template
from . import mail_thread
from . import partner_devices
from . import res_config_settings
from . import res_users
5 changes: 5 additions & 0 deletions viin_brand_mail/models/mail_alias.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ class Alias(models.Model):
_inherit = 'mail.alias'

alias_name = fields.Char(help="The name of the email alias, e.g. 'jobs' if you want to catch emails for <[email protected]>")
alias_model_id = fields.Many2one(help="The model (Viindoo Document Kind) to which this alias "
"corresponds. Any incoming email that does not reply to an "
"existing record will cause the creation of a new record "
"of this model (e.g. a Project Task)",
)
7 changes: 7 additions & 0 deletions viin_brand_mail/models/mail_alias_domain.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from odoo import fields, models


class AliasDomain(models.Model):
_inherit = 'mail.alias.domain'

name = fields.Char(help="Email domain e.g. 'example.com' in '[email protected]'")
28 changes: 28 additions & 0 deletions viin_brand_mail/models/mail_gateway_allowed.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from markupsafe import Markup
from odoo import _, api, models


class MailGatewayAllowed(models.Model):
_inherit = 'mail.gateway.allowed'

@api.model
def get_empty_list_help(self, help_message):
"""
Completely overwrite
"""
get_param = self.env['ir.config_parameter'].sudo().get_param
LOOP_MINUTES = int(get_param('mail.gateway.loop.minutes', 120))
LOOP_THRESHOLD = int(get_param('mail.gateway.loop.threshold', 20))

return Markup(_('''
<p class="o_view_nocontent_smiling_face">
Add addresses to the Allowed List
</p><p>
To protect you from spam and reply loops, Viindoo automatically blocks emails
coming to your gateway past a threshold of <b>%(threshold)i</b> emails every <b>%(minutes)i</b>
minutes. If there are some addresses from which you need to receive very frequent
updates, you can however add them below and Viindoo will let them go through.
</p>''')) % {
'threshold': LOOP_THRESHOLD,
'minutes': LOOP_MINUTES,
}
8 changes: 8 additions & 0 deletions viin_brand_mail/models/mail_mail.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from odoo import fields, models


class MailMail(models.Model):
_inherit = 'mail.mail'

auto_delete = fields.Boolean(help="This option permanently removes any track of email after it's been sent, "
"including from the Technical menu in the Settings, in order to preserve storage space of your Viindoo database.")
8 changes: 8 additions & 0 deletions viin_brand_mail/models/mail_template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from odoo import fields, models


class MailTemplate(models.Model):
_inherit = "mail.template"

auto_delete = fields.Boolean(help="This option permanently removes any track of email after it's been sent, "
"including from the Technical menu in the Settings, in order to preserve storage space of your Viindoo database.")
11 changes: 11 additions & 0 deletions viin_brand_mail/models/mail_thread.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from odoo import models


class MailThread(models.AbstractModel):
_inherit = 'mail.thread'

def _notify_by_web_push_prepare_payload(self, message, msg_vals=False):
payload = super()._notify_by_web_push_prepare_payload(message, msg_vals)
if 'options' in payload and 'icon' in payload['options'] and 'odoo-icon-192x192.png' in payload['options']['icon']:
payload['options']['icon'] = '/viin_brand_mail/static/img/viindoo_app_icon.png'
return payload
10 changes: 10 additions & 0 deletions viin_brand_mail/models/partner_devices.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from odoo import fields, models


class PartnerDevice(models.Model):
_inherit = 'mail.partner.device'

keys = fields.Char(help=("It's refer to browser keys used by the notification: \n"
"- p256dh: It's the subscription public key generated by the browser. The browser will \n"
" keep the private key secret and use it for decrypting the payload\n"
"- auth: The auth value should be treated as a secret and not shared outside of Viindoo"))
8 changes: 8 additions & 0 deletions viin_brand_mail/models/res_config_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from odoo import fields, models


class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'

alias_domain_id = fields.Many2one(help="If you have setup a catch-all email domain redirected to the Viindoo server,"
" enter the domain name here.")
Binary file added viin_brand_mail/static/img/viindoo app icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

This file was deleted.

This file was deleted.

15 changes: 0 additions & 15 deletions viin_brand_mail/static/src/components/composer/composer.scss

This file was deleted.

This file was deleted.

This file was deleted.

47 changes: 0 additions & 47 deletions viin_brand_mail/static/src/components/message/message.scss

This file was deleted.

9 changes: 0 additions & 9 deletions viin_brand_mail/static/src/components/message/message.xml

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit d2839ee

Please sign in to comment.