From 5d17749ff47c02294d5ff2ae56bbcef9d082562e Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Fri, 21 Oct 2016 17:10:57 +0200 Subject: [PATCH 1/4] [FIX] web: repair length field in view list Underscore method _.each expects an array like object when a "length" property is present. This was an issue with a record having a numeric "length" field set to a non-negative value. When changing a line the change would not appear on blur. This issue was fixed with 0e664c9e9 but introduced back with f0e331e00. opw-691070 --- addons/web/static/src/js/view_list.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index a16dddcbf91..ae1a7fa328f 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -554,11 +554,12 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi self.records.remove(record); return; } - _.each(values, function (value, key) { + // _.each is broken if a field "length" is present + for (var key in values) { if (fields[key] && fields[key].type === 'many2many') record.set(key + '__display', false, {silent: true}); - record.set(key, value, {silent: true}); - }); + record.set(key, values[key], {silent: true}); + } record.trigger('change', record); }); }, From 097f46e09a40fe2a5e7c50a8e9c27c897566c7ff Mon Sep 17 00:00:00 2001 From: Simon Lejeune Date: Mon, 24 Oct 2016 15:55:58 +0200 Subject: [PATCH 2/4] [REF] packaging: debian: depend on python-babel Before this patch, the debian package depends on `python-pybabel`. According to the documentation, this is a dummy package for transition from `python-pybabel` to `python-babel`[1]. This dummy package has thus been removed in debian stretch in favor of `python-babel`, and the odoo package is thus not installable in debian stretch. To fix this, we depend directly on `python-babel`, which is available in all debian releases[2]. Closes #13905 [1] https://packages.debian.org/jessie/python-pybabel [2] https://packages.debian.org/jessie/python-babel --- debian/control | 2 +- setup/package.dfdebian | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/control b/debian/control index f6982ecc396..af0f90208c5 100644 --- a/debian/control +++ b/debian/control @@ -16,6 +16,7 @@ Depends: adduser, postgresql-client, python, + python-babel, python-dateutil, python-decorator, python-docutils, @@ -31,7 +32,6 @@ Depends: python-passlib, python-psutil, python-psycopg2, - python-pybabel, python-pychart, python-pydot, python-pyparsing, diff --git a/setup/package.dfdebian b/setup/package.dfdebian index af5c49956c5..1b9c255fa94 100644 --- a/setup/package.dfdebian +++ b/setup/package.dfdebian @@ -20,6 +20,7 @@ RUN apt-get update -qq && \ postgresql \ postgresql-client \ python \ + python-babel \ python-dateutil \ python-decorator \ python-docutils \ @@ -35,7 +36,6 @@ RUN apt-get update -qq && \ python-passlib \ python-psutil \ python-psycopg2 \ - python-pybabel \ python-pychart \ python-pydot \ python-pyparsing \ From 389574e550e58a7ac8a7acdb277a2908d223e13e Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Mon, 24 Oct 2016 17:19:19 +0200 Subject: [PATCH 3/4] [FIX] website: make the 'include assets bundle' option of ace editor work Commit which added summernote broke the ace editor with a strange change: https://github.com/odoo/odoo/commit/9069d0127c176317436b67b23ae5677dd9d53de7#diff-e9d66a1b466f404be082fa00519eafa5L140. With this change instead of not including the assets bundles in the ace editor and allowing to see them by checking the option, the assets bundles were included when NOT in debug mode and not included when in debug mode. --- addons/website/static/src/js/website.ace.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website/static/src/js/website.ace.js b/addons/website/static/src/js/website.ace.js index ad39ac92025..2a3f149fbad 100644 --- a/addons/website/static/src/js/website.ace.js +++ b/addons/website/static/src/js/website.ace.js @@ -137,7 +137,7 @@ var args = { key: $(document.documentElement).data('view-xmlid'), full: true, - bundles: !!$('script[src*=".assets_common"]').length + bundles: this.$('.js_include_bundles')[0].checked }; return openerp .jsonRpc('/website/customize_template_get', 'call', args) From 5ee4344efd0074fac4006984c1eb1ccc4f335518 Mon Sep 17 00:00:00 2001 From: Leonardo Rochael Almeida Date: Wed, 5 Oct 2016 20:45:51 -0300 Subject: [PATCH 4/4] [IMP] Allow configuration of server_wide_modules from file Allow reading and saving the value of `server_wide_modules` from the configuration file, instead of just the command line. --- openerp/tools/config.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/openerp/tools/config.py b/openerp/tools/config.py index d6affc6a407..70b70900b60 100644 --- a/openerp/tools/config.py +++ b/openerp/tools/config.py @@ -118,7 +118,7 @@ class configmanager(object): self.has_ssl = _check_ssl() self._LOGLEVELS = dict([ - (getattr(loglevels, 'LOG_%s' % x), getattr(logging, x)) + (getattr(loglevels, 'LOG_%s' % x), getattr(logging, x)) for x in ('CRITICAL', 'ERROR', 'WARNING', 'INFO', 'DEBUG', 'NOTSET') ]) @@ -142,7 +142,7 @@ class configmanager(object): group.add_option("--addons-path", dest="addons_path", help="specify additional addons paths (separated by commas).", action="callback", callback=self._check_addons_path, nargs=1, type="string") - group.add_option("--load", dest="server_wide_modules", help="Comma-separated list of server-wide modules default=web") + group.add_option("--load", dest="server_wide_modules", help="Comma-separated list of server-wide modules. Default is 'web,web_kanban'") group.add_option("-D", "--data-dir", dest="data_dir", my_default=_get_default_datadir(), help="Directory where to store Odoo data") @@ -443,6 +443,7 @@ class configmanager(object): 'test_file', 'test_enable', 'test_commit', 'test_report_directory', 'osv_memory_count_limit', 'osv_memory_age_limit', 'max_cron_threads', 'unaccent', 'data_dir', + 'server_wide_modules', ] posix_keys = [ @@ -529,14 +530,21 @@ class configmanager(object): #if self.options['db_host']: # self._generate_pgpassfile() + # server_wide_modules defaults to web,web_kanban if empty or unset + server_wide_modules = self.options['server_wide_modules'] = ( + self.options['server_wide_modules'] + if self.options['server_wide_modules'] + else 'web,web_kanban' + ) + if opt.save: self.save() openerp.conf.addons_paths = self.options['addons_path'].split(',') - if opt.server_wide_modules: - openerp.conf.server_wide_modules = map(lambda m: m.strip(), opt.server_wide_modules.split(',')) - else: - openerp.conf.server_wide_modules = ['web','web_kanban'] + + openerp.conf.server_wide_modules = [ + m.strip() for m in server_wide_modules.split(',') + ] def _generate_pgpassfile(self): """