Skip to content
Permalink
Browse files

Merge branch '12.0' into 12.0-web_debranding-docs

  • Loading branch information...
Mirgalimova committed Aug 6, 2019
2 parents 809d58c + de9408d commit 4f203bb8fbbf56e2f1e6e4714535be9f12c6ec22
@@ -3,10 +3,11 @@
# Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
# Copyright 2018 Ildar Nasyrov <https://it-projects.info/team/iledarn>
# Copyright 2018 WohthaN <https://github.com/WohthaN>
# Copyright 2019 Eugene Molotov <https://github.com/em230418>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
{
'name': "Backend debranding",
'version': '12.0.1.0.27',
'version': '12.0.1.0.28',
'author': 'IT-Projects LLC, Ivan Yelizariev',
'license': 'LGPL-3',
'category': 'Debranding',
@@ -1,3 +1,10 @@
`1.0.28`
--------

**Fix:** debrand_bytes now accepts bytes and str types
**Fix:** fixed "OdooBot has a request" item in notifications
**Fix:** included mail_channel fixes

`1.0.27`
--------

@@ -96,4 +96,3 @@ RESULT: No more Odoo word in hints, examples, etc. *There is a placeholder for f
* Send ``/help`` to the chat

RESULT: The message from the Bot open menu has been received.

@@ -6,4 +6,5 @@
from . import ir_config_parameter
from . import ir_ui_view
from . import mail_message
from . import mail_channel
from . import res_users
@@ -3,6 +3,7 @@
# Copyright 2017 ArtyomLosev <https://github.com/ArtyomLosev>
# Copyright 2017 Ilmir Karamov <https://it-projects.info/team/ilmir-k>
# Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
# Copyright 2019 Eugene Molotov <https://github.com/em230418>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).

from odoo import models, api
@@ -4,6 +4,7 @@
# Copyright 2017 Nicolas JEUDY <https://github.com/njeudy>
# Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
# Copyright 2018 Ildar Nasyrov <https://it-projects.info/team/iledarn>
# Copyright 2019 Eugene Molotov <https://it-projects.info/team/molotov>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).

import re
@@ -57,7 +58,9 @@ def debrand(env, source, is_code=False):


def debrand_bytes(env, source):
return bytes(debrand(env, source.decode('utf-8')), 'utf-8')
if type(source) is bytes:
source = source.decode('utf-8')
return bytes(debrand(env, source), 'utf-8')


class IrTranslation(models.Model):
@@ -6,6 +6,9 @@ odoo.define('web_debranding.bot', function (require) {
require('web_debranding.dialog');
var Message = require('mail.model.Message');
var session = require('web.session');
var MailBotService = require('mail_bot.MailBotService');
var core = require('web.core');
var _t = core._t;

Message.include({
_getAuthorName: function () {
@@ -21,4 +24,21 @@ odoo.define('web_debranding.bot', function (require) {
return this._super.apply(this, arguments);
}
});

MailBotService.include({
getPreviews: function (filter) {
var previews = this._super.apply(this, arguments);
previews.map(function(preview) {
if (preview.title == _t("OdooBot has a request")) {
preview.title = _t("Bot has a request");
}
if (preview.imageSRC == "/mail/static/src/img/odoobot.png") {
preview.imageSRC = '/web/binary/company_logo?company_id=' + session.company_id;
}
return preview;
});
return previews;
},
});

});
@@ -1,3 +1,4 @@
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).

from . import test_developer_mode_menu_elements
from . import test_misc
@@ -0,0 +1,17 @@
# Copyright 2019 Eugene Molotov <https://github.com/em230418>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).

import odoo.tests
from ..models.ir_translation import debrand_bytes


@odoo.tests.common.tagged('at_install', 'post_install')
class TestMisc(odoo.tests.TransactionCase):

def test_debrand_bytes(self):
env = self.env
env['ir.config_parameter'].sudo().set_param("web_debranding.new_name", "SuperName")
assert debrand_bytes(env, b'odoo') == b'SuperName'
assert debrand_bytes(env, 'odoo') == b'SuperName'
assert debrand_bytes(env, b'test') == b'test'
assert debrand_bytes(env, 'test') == b'test'

0 comments on commit 4f203bb

Please sign in to comment.
You can’t perform that action at this time.