From 68cde405154c4d255a29c9e6155df22bec5e19a3 Mon Sep 17 00:00:00 2001 From: jlzhou Date: Mon, 28 Aug 2017 11:37:59 +0800 Subject: [PATCH 01/13] [FIX] mail: fix translation issue in client notification Closes #19095. --- addons/mail/static/src/js/chat_manager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/static/src/js/chat_manager.js b/addons/mail/static/src/js/chat_manager.js index d3fcf998d5d..c4911912109 100644 --- a/addons/mail/static/src/js/chat_manager.js +++ b/addons/mail/static/src/js/chat_manager.js @@ -536,7 +536,7 @@ function on_partner_notification (data) { } remove_channel(channel); chat_manager.bus.trigger("unsubscribe_from_channel", data.id); - web_client.do_notify(_("Unsubscribed"), msg); + web_client.do_notify(_t("Unsubscribed"), msg); } } else if (data.type === 'toggle_star') { on_toggle_star_notification(data); From c7b1faa458277c516464304cc8ab9024f424bf42 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Mon, 11 Jun 2018 15:24:57 +0200 Subject: [PATCH 02/13] [FIX] web_calendar: color of sidebar filter Before this rev., if you went to Sales > Sales order, switched to calendar view, edited the arch such that 'color="state"' is replaced by 'color="invoice_status"' on the root node, it crashed. The reason of the crash is that a possible value of the 'invoice_status' selection field is 'to invoice' (it contains a whitespace), and the JQuery selector didn't wrap the value by quotes. OPW~1856305 --- addons/web_calendar/static/src/js/widgets.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_calendar/static/src/js/widgets.js b/addons/web_calendar/static/src/js/widgets.js index 39324d3caf0..23a63415d54 100644 --- a/addons/web_calendar/static/src/js/widgets.js +++ b/addons/web_calendar/static/src/js/widgets.js @@ -214,7 +214,7 @@ var SidebarFilter = Widget.extend({ var self = this; _.forEach(self.view.all_filters, function(o) { if (_.contains(self.view.now_filter_ids, o.value)) { - self.$('div.o_calendar_responsible input[value=' + o.value + ']').prop('checked',o.is_checked); + self.$('div.o_calendar_responsible input[value="' + o.value + '"]').prop('checked',o.is_checked); } }); }, From b10e34ed1a037595a29d6952bd7cbcb55d8aba8c Mon Sep 17 00:00:00 2001 From: Xavier Brochard Date: Sat, 19 May 2018 01:27:16 +0200 Subject: [PATCH 03/13] [FIX] web_editor: add as inline tag and remove duplicate strong This commit closes #24818 --- addons/web_editor/static/src/js/rte.summernote.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/rte.summernote.js b/addons/web_editor/static/src/js/rte.summernote.js index 6ba5ac6eeaa..f6435d0e6fe 100644 --- a/addons/web_editor/static/src/js/rte.summernote.js +++ b/addons/web_editor/static/src/js/rte.summernote.js @@ -476,7 +476,7 @@ function prettify_html(html) { while (i--) space += ' '; return space; }, - reg = /^<\/?(a|span|font|strong|u|i|strong|b)(\s|>)/i, + reg = /^<\/?(a|span|font|u|em|i|strong|b)(\s|>)/i, inline_level = Infinity, tokens = _.compact(_.flatten(_.map(html.split(//); From 232d5ca64bbb43a096f149ae053509ba72a1709f Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Wed, 13 Jun 2018 15:07:34 +0200 Subject: [PATCH 04/13] [FIX] stock: onchange like pr 25223 --- addons/stock/models/stock_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py index a0f774109e1..adf4dd2c410 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -411,7 +411,7 @@ class StockMove(models.Model): self.product_uom_qty = 1.0 return {'domain': {'product_uom': [('category_id', '=', product.uom_id.category_id.id)]}} - @api.onchange('date') + @api.onchange('date_expected') def onchange_date(self): if self.date_expected: self.date = self.date_expected From a8dd1de5c466b64351d54536ac0529d2a744cf4d Mon Sep 17 00:00:00 2001 From: Antonio Espinosa Date: Fri, 28 Oct 2016 09:20:08 +0200 Subject: [PATCH 05/13] [IMP] doc: add i18n section to command line reference Closes #14042 --- doc/reference/cmdline.rst | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/doc/reference/cmdline.rst b/doc/reference/cmdline.rst index 0e9094a898f..20f3d582944 100644 --- a/doc/reference/cmdline.rst +++ b/doc/reference/cmdline.rst @@ -156,6 +156,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 ------------- From fd2b130428cbdec9481176620ada8ec9f6490f4d Mon Sep 17 00:00:00 2001 From: Miku Laitinen Date: Thu, 7 Dec 2017 16:32:39 +0200 Subject: [PATCH 06/13] [FIX] sale: Add missing import to 'account_config_settings_views.xml' in manifest Coming from the migration of sale https://github.com/odoo/odoo/commit/f3d715ca94f24f86ce39a4bc6873fe7576ef1860#diff-7ca766af4bd53a0bc808dd3a4ead8317 --- addons/sale/__manifest__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/sale/__manifest__.py b/addons/sale/__manifest__.py index 22682ce55d8..673185b782b 100644 --- a/addons/sale/__manifest__.py +++ b/addons/sale/__manifest__.py @@ -54,6 +54,7 @@ The Dashboard for the Sales Manager will include 'security/sale_security.xml', 'security/ir.model.access.csv', 'wizard/sale_make_invoice_advance_views.xml', + 'views/account_config_settings_views.xml', 'views/sale_views.xml', 'views/sales_team_views.xml', 'views/res_partner_views.xml', From f03f2f7c8acc7126e370208ea86765785850696d Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Wed, 13 Jun 2018 15:51:35 +0200 Subject: [PATCH 07/13] [FIX] account: print move lines with no label Field 'name' (Label) on account_move_line isn't required. When following the usual flows, it is automatically set by the system. However, one can manually create move lines without specifying it. When this occurs, the Sale/Purchase Journal can't be printed anymore because it causes a crash. OPW~1857663 --- addons/account/views/report_journal.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/views/report_journal.xml b/addons/account/views/report_journal.xml index 41abc050cd0..15d5262d089 100644 --- a/addons/account/views/report_journal.xml +++ b/addons/account/views/report_journal.xml @@ -50,7 +50,7 @@ - + From c4ddf55880b7aa83580aa8ab312ba71f093a7587 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Mon, 11 Jun 2018 15:26:16 +0200 Subject: [PATCH 08/13] [FIX] web_editor: link don't duplicate child text If we applied a link eg. on: ``` hello world ``` The system actually gets the "label": hello worldworld because there is 3 nodes: text node: hello element node: `world` text node: world Also since "hello worldworld" is different than "hello world", instead of just keeping existing nodes and adding the link, the system would replace the selected range by: `hello worldworld' instead of: `hello world` This commit ignores element nodes when creating a new link, since when getting the label of the link from the selection, only the text nodes insides the element nodes have any interest. There was a second issue because if we had: ``` world! ``` and tried to put a link over "world!", the code would decide: "world" is inside a link so we will just update that link. Thus we would get: ``` world!! ``` instead of: ``` world! ``` opw-1848351 closes #25187 --- .../web_editor/static/lib/summernote/src/js/module/Editor.js | 4 ++-- addons/web_editor/static/src/js/widgets.js | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) 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 a30ee9c18c8..3ae8f60db7d 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 @@ -629,9 +629,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 f23e196997a..b7e21996e45 100644 --- a/addons/web_editor/static/src/js/widgets.js +++ b/addons/web_editor/static/src/js/widgets.js @@ -1025,6 +1025,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) { From 50418c481182cb414792da32f2a0529503e59f9c Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Wed, 13 Jun 2018 17:04:34 +0200 Subject: [PATCH 09/13] [FIX] web_editor: properly save media dialog without any image When saving the media dialog without any selected image, a crash occurred. Now, it properly closes the dialog. opw-1858614 --- addons/web_editor/static/src/js/widgets.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/web_editor/static/src/js/widgets.js b/addons/web_editor/static/src/js/widgets.js index b7e21996e45..675c5c60598 100644 --- a/addons/web_editor/static/src/js/widgets.js +++ b/addons/web_editor/static/src/js/widgets.js @@ -326,8 +326,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; } if (!img.is_document) { From 84acd427b8adc6f2c3dc3767ca8ee8f99e4ccbd7 Mon Sep 17 00:00:00 2001 From: RomainLibert Date: Tue, 12 Jun 2018 11:42:01 +0200 Subject: [PATCH 10/13] [FIX] website_event: allow controller to read event.registration The controller /event//registration/confirm was broken since the portal user cannot read event.registration objects. In 9.0 this was not an issue as we browsed and sudoed the event.registration, but since in 10.0 this line disapeared so did the sudo which this commit reintroduces. --- addons/website_event/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_event/controllers/main.py b/addons/website_event/controllers/main.py index d4be8fb5132..1dd43541c94 100644 --- a/addons/website_event/controllers/main.py +++ b/addons/website_event/controllers/main.py @@ -255,6 +255,6 @@ class WebsiteEventController(http.Controller): Attendees._prepare_attendee_values(registration)) return request.render("website_event.registration_complete", { - 'attendees': Attendees, + 'attendees': Attendees.sudo(), 'event': event, }) From c13d67dd25b63693c7a90012ce9eba59f12dc813 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 14 Jun 2018 15:42:59 +0200 Subject: [PATCH 11/13] [FIX] website: valid time zone guessed from GeoIP The timezone returned by GeoIP may be unknown by `pytz` due to incompatibilities between GeoIP and pytz databases (which may be outdated). --- addons/website/models/ir_http.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/website/models/ir_http.py b/addons/website/models/ir_http.py index 70cb480c86d..a25c8c9c263 100644 --- a/addons/website/models/ir_http.py +++ b/addons/website/models/ir_http.py @@ -5,6 +5,7 @@ import re import time import traceback +import pytz import werkzeug import werkzeug.routing import werkzeug.utils @@ -159,6 +160,11 @@ class ir_http(orm.AbstractModel): request.context['edit_translations'] = False if not request.context.get('tz'): request.context['tz'] = request.session.get('geoip', {}).get('time_zone') + try: + pytz.timezone(request.context['tz'] or '') + except pytz.UnknownTimeZoneError: + request.context.pop('tz') + # bind modified context request.website = request.website.with_context(request.context) From 5233dbdb54ac03e52b991be0d0495b8a0a95b8c8 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Wed, 13 Jun 2018 15:22:12 +0200 Subject: [PATCH 12/13] [FIX] core: do not clear cache when removing registry from pool No need to force other workers to reset their cache. --- openerp/modules/registry.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openerp/modules/registry.py b/openerp/modules/registry.py index 35966773ae5..e715f1e234e 100644 --- a/openerp/modules/registry.py +++ b/openerp/modules/registry.py @@ -415,7 +415,6 @@ class RegistryManager(object): """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 From 90165e2d96ac27dd1dbb2e367d47b8a38b7aea40 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Wed, 13 Jun 2018 15:30:24 +0200 Subject: [PATCH 13/13] [FIX] WorkerCron: keep registry alive after job processing --- openerp/service/server.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openerp/service/server.py b/openerp/service/server.py index af01ea9d54f..faade2985b7 100644 --- a/openerp/service/server.py +++ b/openerp/service/server.py @@ -795,7 +795,6 @@ class WorkerCron(Worker): import openerp.addons.base as base base.ir.ir_cron.ir_cron._acquire_job(db_name) - openerp.modules.registry.RegistryManager.delete(db_name) # dont keep cursors in multi database mode if len(db_names) > 1: