Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions setup/stop_auto_subscribe_partners/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
17 changes: 17 additions & 0 deletions stop_auto_subscribe_partners/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Stop Auto Subscribe Partners

Stop Auto Subscribe Partners is a tool to enable/disable subscription of users and
followers . You should fill the field under general settings to complete the
configurations.

# Features!

- Stop Auto Subscribe Partners

> After instllation of this module, you have to fill the details under

Settings > General Settings > Auto Emails and Auto Subscribe.

### Installation

After installation you can configure details under general settings.
1 change: 1 addition & 0 deletions stop_auto_subscribe_partners/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import model
26 changes: 26 additions & 0 deletions stop_auto_subscribe_partners/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
##############################################################################
#
#
# Part of cube48.de.
#
#
##############################################################################
{
"name": "Stop Auto Subscribe Partners",
"summary": """
New partners will not become auto followers any longer.""",
"description": """
New partners will not become auto followers any longer.
""",
"author": "cube48 AG, Coop IT Easy SC",
"website": "https://coopiteasy.be",
"category": "Tools",
"version": "12.0.1.0.0",
"depends": ["base", "mail", "base_setup"],
"data": [
"views/views.xml",
],
"images": ["static/description/banner.png"],
"license": "AGPL-3",
"installable": True,
}
36 changes: 36 additions & 0 deletions stop_auto_subscribe_partners/i18n/de.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stop_auto_subscribe_partners
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-07-02 10:28+0000\n"
"PO-Revision-Date: 2016-07-02 10:28+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: stop_auto_subscribe_partners
#: model:ir.ui.view,arch_db:stop_auto_subscribe_partners.res_config_settings_view_form
msgid "Auto Emails and Auto Subscribe"
msgstr "Auto-E-Mails und Auto-Abonnements"

#. module: stop_auto_subscribe_partners
#: model:ir.ui.view,arch_db:stop_auto_subscribe_partners.res_config_settings_view_form
msgid "Stop Auto Emails and Auto Subscribe"
msgstr "Stoppen Sie Auto-E-Mails und Auto-Abonnements"

#. module: stop_auto_subscribe_partners
#: model:ir.ui.view,arch_db:stop_auto_subscribe_partners.res_config_settings_view_form
msgid "By default, new users will be in Auto Subscribe."
msgstr "Standardmäßig sind neue Benutzer in Auto-Abonnements enthalten."

#. module: stop_auto_subscribe_partners
#: model:ir.ui.view,arch_db:stop_auto_subscribe_partners.res_config_settings_view_form
msgid "Stop"
msgstr "Halt"
2 changes: 2 additions & 0 deletions stop_auto_subscribe_partners/model/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import website
from . import mail_thread
47 changes: 47 additions & 0 deletions stop_auto_subscribe_partners/model/mail_thread.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright 2017 Jarvis (www.odoomod.com)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).

from distutils.util import strtobool

from odoo import api, models


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

@api.multi
def message_subscribe(self, partner_ids=None, channel_ids=None, subtype_ids=None):
ir_config = self.env["ir.config_parameter"]
app_stop_subscribe = bool(
strtobool(ir_config.sudo().get_param("app_stop_subscribe"))
)
if app_stop_subscribe:
return
else:
return super(MailThread, self).message_subscribe(
partner_ids, channel_ids, subtype_ids
)

@api.multi
def _message_auto_subscribe(self, updated_values):
ir_config = self.env["ir.config_parameter"]
app_stop_subscribe = bool(
strtobool(ir_config.sudo().get_param("app_stop_subscribe"))
)
if app_stop_subscribe:
return
else:
return super(MailThread, self)._message_auto_subscribe(updated_values)

@api.multi
def _message_auto_subscribe_notify(self, partner_ids, template):
ir_config = self.env["ir.config_parameter"]
app_stop_subscribe = bool(
strtobool(ir_config.sudo().get_param("app_stop_subscribe"))
)
if app_stop_subscribe:
return
else:
return super(MailThread, self)._message_auto_subscribe_notify(
partner_ids, template
)
29 changes: 29 additions & 0 deletions stop_auto_subscribe_partners/model/website.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from odoo import api, fields, models


class WebsiteConfig(models.TransientModel):
_inherit = "res.config.settings"

app_stop_subscribe = fields.Boolean(
"Stop Odoo Subscribe(Performance Improve)",
help=u"Check to stop Odoo Subscribe function",
)

@api.model
def get_values(self):
ir_config = self.env["ir.config_parameter"]
app_stop_subscribe = (
True
if ir_config.sudo().get_param("app_stop_subscribe") == "True"
else False
)

return dict(
app_stop_subscribe=app_stop_subscribe,
)

def set_values(self):
self.ensure_one()
ir_config = self.env["ir.config_parameter"]
ir_config.set_param("app_stop_subscribe", self.app_stop_subscribe or "False")
return True
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions stop_auto_subscribe_partners/static/description/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h1 class="oe_slogan" style="color:#333333;">Stop Auto Subscribe Partners</h1>
<div class="" style="text-align: left;">
<h3 class="oe_slogan" style="color:black;line-height: 1.3;">With this module new partners will not become auto followers any longer. Customers or suppliers will not get unintended messages or confidential information. Never again forget to unsubscribe partners!</h3>
<img style="max-width: 100%;" src="page1.png"/><br><br>
<h3 class="oe_slogan" style="color:black;line-height: 1.3;">Works only for new partners and can of course be overwritten by the user.</h3>
<h3 class="oe_slogan" style="color:black;line-height: 1.3;">Please note that by default this option is not set. You will find the checkbox in <br/> Settings > General Settings > Auto Emails and Auto Subscribe.</h3>
</div>
</div>
</div>
</section>

<section class="oe_container oe_dark">
<img src="cube48.png" style="width: 330px;display: block;margin-left: auto;margin-right: auto;" class="center-block">
<div class="oe_slogan" style="margin-top:-20px !important;">
<h3><a style="color: #333333 !important;" href="https://www.cube48.de/">www.cube48.de</a> | <a style="color: #333333 !important;" href="mailto:[email protected]?Subject=Odoo App Store request"> [email protected]</a></h3>
</div>
<h3 class="oe_slogan" style="color:black;">Please contact us for support requests, training, app customizations or entire app developments.</h3>
</section>

<!-- <section class="oe_container oe_separator"></section> -->
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions stop_auto_subscribe_partners/views/views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<odoo>
<record id="res_config_settings_view_form_debrand" model="ir.ui.view">
<field name="name">Stop Auto Subscribe</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="base_setup.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath expr="//div[@id='business_documents']" position="after">
<div id="auto_email_subscribe">
<h2>Auto Emails and Auto Subscribe</h2>
<div class="row mt16 o_settings_container">
<div
class="col-xs-12 col-md-6 o_setting_box"
title="By default, new users will be in Auto Subscribe."
>
<div class="o_setting_left_pane">
<field name="app_stop_subscribe" />
</div>
<div class="o_setting_right_pane">
<label string="Stop" for="app_stop_subscribe" />
<div class="text-muted">
Stop Auto Emails and Auto Subscribe
</div>
</div>
</div>
</div>
</div>
</xpath>
</field>
</record>
</odoo>