diff --git a/addons/web_editor/static/lib/summernote/src/js/module/Editor.js b/addons/web_editor/static/lib/summernote/src/js/module/Editor.js index b7ba30bfcd1..99947c346cf 100644 --- a/addons/web_editor/static/lib/summernote/src/js/module/Editor.js +++ b/addons/web_editor/static/lib/summernote/src/js/module/Editor.js @@ -628,9 +628,9 @@ define([ } var anchors = []; - // ODOO: adding this branch to modify existing anchor + // ODOO: adding this branch to modify existing anchor if it fully contains the range var ancestor_anchor = dom.ancestor(rng.sc, dom.isAnchor); - if(ancestor_anchor) { + if(ancestor_anchor && ancestor_anchor === dom.ancestor(rng.ec, dom.isAnchor)) { anchors.push($(ancestor_anchor).html(linkText).get(0)); } else if (isTextChanged) { // Create a new link when text changed. diff --git a/addons/web_editor/static/src/js/widgets.js b/addons/web_editor/static/src/js/widgets.js index 005d085fec8..dc347c61690 100644 --- a/addons/web_editor/static/src/js/widgets.js +++ b/addons/web_editor/static/src/js/widgets.js @@ -320,8 +320,7 @@ var ImageDialog = Widget.extend({ var img = this.images[0]; if (!img) { - var id = this.$(".existing-attachments [data-src]:first").data('id'); - img = _.find(this.images, function (img) { return img.id === id;}); + return this.media; } var media; @@ -1023,6 +1022,8 @@ var LinkDialog = Dialog.extend({ if (dom.ancestor(nodes[i], dom.isImg)) { this.data.images.push(dom.ancestor(nodes[i], dom.isImg)); text += '[IMG]'; + } else if (!is_link && nodes[i].nodeType === 1) { + // just use text nodes from listBetween } else if (!is_link && i===0) { text += nodes[i].textContent.slice(so, Infinity); } else if (!is_link && i===nodes.length-1) { diff --git a/addons/website/models/ir_http.py b/addons/website/models/ir_http.py index e04b486a54a..8149a23b406 100644 --- a/addons/website/models/ir_http.py +++ b/addons/website/models/ir_http.py @@ -6,6 +6,7 @@ import os import re import traceback +import pytz import werkzeug import werkzeug.routing import werkzeug.utils @@ -204,6 +205,11 @@ class Http(models.AbstractModel): context['edit_translations'] = False if not context.get('tz'): context['tz'] = request.session.get('geoip', {}).get('time_zone') + try: + pytz.timezone(context['tz'] or '') + except pytz.UnknownTimeZoneError: + context.pop('tz') + # bind modified context request.context = context request.website = request.website.with_context(context) diff --git a/doc/reference/cmdline.rst b/doc/reference/cmdline.rst index 6e08973d60e..21f5b80ba6d 100644 --- a/doc/reference/cmdline.rst +++ b/doc/reference/cmdline.rst @@ -170,6 +170,45 @@ database when creating new databases from the database-management screens, use the specified `template database`_. Defaults to ``template1``. +.. _reference/cmdline/server/internationalisation: + +Internationalisation +-------------------- + +Use these options to translate Odoo to another language. See i18n section of +the user manual. Option '-d' is mandatory. Option '-l' is mandatory in case +of importation + +.. option:: --load-language + + specifies the languages (separated by commas) for the translations you + want to be loaded + +.. option:: -l, --language + + specify the language of the translation file. Use it with --i18n-export + or --i18n-import + +.. option:: --i18n-export + + export all sentences to be translated to a CSV file, a PO file or a TGZ + archive and exit. + +.. option:: --i18n-import + + import a CSV or a PO file with translations and exit. The '-l' option is + required. + +.. option:: --i18n-overwrite + + overwrites existing translation terms on updating a module or importing + a CSV or a PO file. + +.. option:: --modules + + specify modules to export. Use in combination with --i18n-export + + built-in HTTP ------------- diff --git a/odoo/modules/registry.py b/odoo/modules/registry.py index 9d06e34a49c..7bdff852c67 100644 --- a/odoo/modules/registry.py +++ b/odoo/modules/registry.py @@ -151,7 +151,6 @@ class Registry(Mapping): """ Delete the registry linked to a given database. """ with cls._lock: if db_name in cls.registries: - cls.registries[db_name].clear_caches() del cls.registries[db_name] @classmethod diff --git a/odoo/service/server.py b/odoo/service/server.py index be3de54d529..45b02f9f1da 100644 --- a/odoo/service/server.py +++ b/odoo/service/server.py @@ -812,7 +812,6 @@ class WorkerCron(Worker): import odoo.addons.base as base base.ir.ir_cron.ir_cron._acquire_job(db_name) - odoo.modules.registry.Registry.delete(db_name) # dont keep cursors in multi database mode if len(db_names) > 1: