From 5817531f0b3982344be018eaceefcefed30fe58b Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Wed, 1 Jul 2015 17:00:11 +0200 Subject: [PATCH 1/4] [ADD] support_branding --- support_branding/README.rst | 94 +++++++++++++++ support_branding/__init__.py | 0 support_branding/__openerp__.py | 39 ++++++ support_branding/data/ir_config_parameter.xml | 25 ++++ support_branding/i18n/nl.po | 48 ++++++++ support_branding/i18n/support_branding.pot | 48 ++++++++ support_branding/static/description/icon.png | Bin 0 -> 13573 bytes .../static/src/css/support_branding.css | 5 + .../static/src/js/support_branding.js | 114 ++++++++++++++++++ support_branding/static/src/xml/base.xml | 17 +++ support_branding/views/qweb.xml | 17 +++ 11 files changed, 407 insertions(+) create mode 100644 support_branding/README.rst create mode 100644 support_branding/__init__.py create mode 100644 support_branding/__openerp__.py create mode 100644 support_branding/data/ir_config_parameter.xml create mode 100644 support_branding/i18n/nl.po create mode 100644 support_branding/i18n/support_branding.pot create mode 100644 support_branding/static/description/icon.png create mode 100644 support_branding/static/src/css/support_branding.css create mode 100644 support_branding/static/src/js/support_branding.js create mode 100644 support_branding/static/src/xml/base.xml create mode 100644 support_branding/views/qweb.xml diff --git a/support_branding/README.rst b/support_branding/README.rst new file mode 100644 index 00000000..949db799 --- /dev/null +++ b/support_branding/README.rst @@ -0,0 +1,94 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :alt: License: AGPL-3 + +Support branding +================ + +If you run an Odoo support company and you support customers without an OPW, +you can brand the Odoo instance accordingly using this module. This module will +add a line `Supported by $yourcompany` in the menu footer and add a button to +mail exception messages to your support email address. + + +Configuration +============= + +This module is controlled by config parameters: + +support_branding.company_name + Your company's name + +support_branding.company_url + Your company's website + +support_branding.company_color + The color to show your company's name in (CSS syntax) + +support_branding.support_email + The (optional) mailaddress to contact for support + +support_branding.release + The (optional) version number of your deployment + +You probably want to depend on this module in your customer specific module and +add the following XML:: + + + Your company + + + https://yourwebsite.com + + + #000 + + + support@yourwebsite.com + + + support@yourwebsite.com + + + 42 + Configuration + +Note that the email button is only visible if you configure an email address, +the default is empty! + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed feedback +`here `_. + + +Credits +======= + +Contributors +------------ + +* Holger Brunn +* Stefan Rijnhart + +Icon +---- + +* https://commons.wikimedia.org/wiki/File:Crystal_Clear_app_khelpcenter.png + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +To contribute to this module, please visit http://odoo-community.org. diff --git a/support_branding/__init__.py b/support_branding/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/support_branding/__openerp__.py b/support_branding/__openerp__.py new file mode 100644 index 00000000..38ca03a0 --- /dev/null +++ b/support_branding/__openerp__.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# This module copyright (C) 2012-2015 Therp BV (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## +{ + "name": "Support branding", + "summary": "Adds your branding to an Odoo instance", + "category": "Dependecy/Hidden", + "version": "2.0", + "author": "Therp BV,Odoo Community Association (OCA)", + "website": 'http://therp.nl', + "depends": [ + 'web', + ], + "qweb": [ + 'static/src/xml/base.xml', + ], + "data": [ + "data/ir_config_parameter.xml", + 'views/qweb.xml', + ], + 'active': True, +} diff --git a/support_branding/data/ir_config_parameter.xml b/support_branding/data/ir_config_parameter.xml new file mode 100644 index 00000000..fcc62f88 --- /dev/null +++ b/support_branding/data/ir_config_parameter.xml @@ -0,0 +1,25 @@ + + + + + support_branding.company_name + Odoo Community Association (OCA) + + + support_branding.company_url + https://odoo-community.org + + + support_branding.company_color + #b163a3 + + + support_branding.support_email + + + + support_branding.release + + + + diff --git a/support_branding/i18n/nl.po b/support_branding/i18n/nl.po new file mode 100644 index 00000000..374eecbb --- /dev/null +++ b/support_branding/i18n/nl.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * support_branding +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-01-30 10:05+0000\n" +"PO-Revision-Date: 2015-01-30 10:05+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: support_branding +#: view:website:web.menu_secondary +msgid "Version " +msgstr "Versie " + +#. module: support_branding +#: view:website:web.menu_secondary +msgid ", supported by" +msgstr ", ondersteund door" + +#. module: support_branding +#. openerp-web +#: code:addons/support_branding/static/src/js/support_branding.js:39 +#, python-format +msgid "Email to %s" +msgstr "E-mail naar %s" + +#. module: support_branding +#. openerp-web +#: code:addons/support_branding/static/src/xml/base.xml:9 +#, python-format +msgid "Email to support company" +msgstr "E-mail naar ondersteunend bedrijf" + +#. module: support_branding +#. openerp-web +#: code:addons/support_branding/static/src/xml/base.xml:9 +#, python-format +msgid "Please fill in how you produced this error..." +msgstr "Beschrijft u alstublieft de stappen om deze fout te reproduceren..." + diff --git a/support_branding/i18n/support_branding.pot b/support_branding/i18n/support_branding.pot new file mode 100644 index 00000000..c55e08d9 --- /dev/null +++ b/support_branding/i18n/support_branding.pot @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * support_branding +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-01-30 10:05+0000\n" +"PO-Revision-Date: 2015-01-30 10:05+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: support_branding +#: view:website:web.menu_secondary +msgid "Version " +msgstr "" + +#. module: support_branding +#: view:website:web.menu_secondary +msgid ", supported by" +msgstr "" + +#. module: support_branding +#. openerp-web +#: code:addons/support_branding/static/src/js/support_branding.js:39 +#, python-format +msgid "Email to %s" +msgstr "" + +#. module: support_branding +#. openerp-web +#: code:addons/support_branding/static/src/xml/base.xml:9 +#, python-format +msgid "Email to Company" +msgstr "" + +#. module: support_branding +#. openerp-web +#: code:addons/support_branding/static/src/xml/base.xml:9 +#, python-format +msgid "Please fill in how you produced this error..." +msgstr "" + diff --git a/support_branding/static/description/icon.png b/support_branding/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..f181838db7a2a1d937738f69d8219d0529a131fd GIT binary patch literal 13573 zcmYjYWmHsM+nyPQ&OreI>4!!@8mXZXM7p~bX^w0x8jS9f1H@?oAU&U|#i8#8ae0;LwZ{OxnNWnUc9@#k(D3g5BrWqxh@rP zVN>s5^F^^|KcbH6MZ>7n2Wyn$knv(s!bc>e4!+UoybNyqkSSZkfS~FvZlL-RVP>-= z(C70Qn-m_QwrbFNKgw-66dDm3NzoN>SaJ%}_qr}AE@t1{-cBDL98_3o^M0smSn(_= zOaY{!Kbo&BkSyTef+o*4NcAe=RWSs8L)-b^{}H-6b^3E#%<7xH;rSBto`+{@31}=N zQjwi4VW6rS=eyPwM1}uWpz_<@`PSYt_>0)C`I@u)H>FxC9PDn$+vE?4?>RX7*nSQo zCX;{mh2NZTDC*U-aZ^)waGCamdKxl2a9wOS7(UX=kqW_sq@6Y?+qxmbR8>>U z85tO08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AT zmA{I;0W*zR->hU$i(>B;9G|^@J@Yh62-PNL*Pp|d`n`sfdzzoXa$MivWBbuw0zY~- zOMp?i97b3&-$K?Vx`H66M!por-?{I9`Q#gOzDZh5`!OuKbm`e?2MYa#%xPQza7J1j z8d~Eb;3-ikQ5E%?L15iK2e}m?A<8>00Y%@S z3j*L`hj+9WhLxT+wO7dDd zmF*6p!6w_UD(~ZB1=fA5T z`Iu)uc7X-e+MP!oc;S}>eBB0&dC`PW$`Q#c2XdCKb=}O_!xu9f>=z1%dIe?1JFq{j zEP)l$-qBp8cUb|-@`984`ec+MdL>r(Zf!Eh&AAe944U~gy^fb68Td<$y0uUrY6d0u z5#7XBCN^sPzzty_SC_ZcP3zb?gn+&Sy*wtAkkGz z-AVA4FJ~z>*mW7aYxoCqto8rx89MG=JAVQ4YHjQdkl>RJLE@ABdf1aI1 ARsaA1 literal 0 HcmV?d00001 diff --git a/support_branding/static/src/css/support_branding.css b/support_branding/static/src/css/support_branding.css new file mode 100644 index 00000000..fcac3884 --- /dev/null +++ b/support_branding/static/src/css/support_branding.css @@ -0,0 +1,5 @@ +.support-branding-submit-form +{ + display: inline; + margin: 0px; +} diff --git a/support_branding/static/src/js/support_branding.js b/support_branding/static/src/js/support_branding.js new file mode 100644 index 00000000..30534e7d --- /dev/null +++ b/support_branding/static/src/js/support_branding.js @@ -0,0 +1,114 @@ +/* + + Copyright (C) 2012-2015 Therp BV + License: GNU AFFERO GENERAL PUBLIC LICENSE + Version 3 or any later version + + Usage: if you run an OpenERP support company and you support + customers without an OPW, you can brand the OpenERP instance + accordingly using this module. Please enter the two variables + in the code below, 'support_name' and 'support_link'. They will + replace the unfriendly message about the OpenERP instance not + being supported. + + */ + +openerp.support_branding = function(instance) { + var QWeb = instance.web.qweb, + _t = instance.web._t; + + instance.web.CrashManager.include({ + init: function() + { + var self = this, + ir_config_parameter = new openerp.web.Model('ir.config_parameter'); + ir_config_parameter.call( + 'get_param', ['support_branding.support_email']).then( + function(email) + { + self.support_branding_support_email = email; + }); + ir_config_parameter.call( + 'get_param', ['support_branding.company_name']).then( + function(name) + { + self.support_branding_company_name = name; + }); + return this._super(this, arguments); + }, + show_error: function(error) + { + var self = this; + this._super.apply(this, arguments); + jQuery('.support-branding-submit-form').each(function() + { + var $form = jQuery(this), + $button = $form.find('button'), + $description = $form.find('textarea[name="description"]'), + $subject = $form.find('input[name="subject"]'), + $body = $form.find('input[name="body"]'); + if(self.support_branding_support_email) + { + $form.attr( + 'action', + 'mailto:' + self.support_branding_support_email); + $form.parents('.modal').find('.modal-body') + .css('max-height', '70vh'); + $button.click(function(ev) + { + var mail_mail = new instance.web.Model('mail.mail'); + if(!$description.val()) + { + $description.parent().addClass('oe_form_invalid'); + ev.preventDefault(); + return; + } + mail_mail.call( + 'create', + [{ + state: 'outgoing', + auto_delete: false, + email_to: self.support_branding_support_email, + subject: $subject.val(), + body_html: jQuery('
    ').append( + jQuery('
    ').text($description.val()), + jQuery('
    ').text($body.val())
    +                                ).html(),
    +                            }])
    +                        .then(function(mail_id)
    +                        {
    +                            return mail_mail.call('send', [[mail_id]]);
    +                        }, function()
    +                        {
    +                            // if the call failed, fire the mailto link
    +                            // hoping there is a properly configured email
    +                            // client
    +                            $body.val($description.val() + '\n' + $body.val())
    +                            $button.unbind('click');
    +                            $button.click();
    +                        })
    +                        .then(function()
    +                        {
    +                            $form.parents('.modal').modal('hide');
    +                        });
    +                        ev.preventDefault();
    +                    });
    +                }
    +                else
    +                {
    +                    $description.hide();
    +                    $button.hide();
    +                }
    +                if(self.support_branding_company_name)
    +                {
    +                    $button.text(
    +                        _.str.sprintf(
    +                            openerp.web._t('Email to %s'),
    +                            self.support_branding_company_name));
    +                }
    +                $form.prependTo(
    +                    $form.parents('.modal-dialog').find('.modal-footer'));
    +            });
    +        }
    +    });
    +};
    diff --git a/support_branding/static/src/xml/base.xml b/support_branding/static/src/xml/base.xml
    new file mode 100644
    index 00000000..bcbf8aca
    --- /dev/null
    +++ b/support_branding/static/src/xml/base.xml
    @@ -0,0 +1,17 @@
    +
    +
    +    
    +        
    +            
    +
    + + +
    +