From 514bdcb0f1c084e87f6f809c4e893468836cce0c Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 4 May 2017 16:48:31 +0200 Subject: [PATCH 1/5] [FIX] tools: unnecessary error logging The limit of 64 characters on the XMLID has been removed a long time ago. This error is therefore not necessary anymore. --- odoo/tools/convert.py | 3 --- odoo/tools/yaml_import.py | 2 -- 2 files changed, 5 deletions(-) diff --git a/odoo/tools/convert.py b/odoo/tools/convert.py index 0d0b14ab341..284b1f783ce 100644 --- a/odoo/tools/convert.py +++ b/odoo/tools/convert.py @@ -250,9 +250,6 @@ form: module.record_id""" % (xml_id,) modcnt = self.env['ir.module.module'].search_count([('name', '=', module), ('state', '=', 'installed')]) assert modcnt == 1, """The ID "%s" refers to an uninstalled module""" % (xml_id,) - if len(id) > 64: - _logger.error('id: %s is to long (max: 64)', id) - def _tag_delete(self, rec, data_node=None, mode=None): d_model = rec.get("model") d_search = rec.get("search",'').encode('utf-8') diff --git a/odoo/tools/yaml_import.py b/odoo/tools/yaml_import.py index 93394a48f67..ced0738647a 100644 --- a/odoo/tools/yaml_import.py +++ b/odoo/tools/yaml_import.py @@ -139,8 +139,6 @@ class YamlInterpreter(object): if module != self.module: module_count = self.env['ir.module.module'].search_count([('name', '=', module), ('state', '=', 'installed')]) assert module_count == 1, 'The ID "%s" refers to an uninstalled module.' % (xml_id,) - if len(id) > 64: # TODO where does 64 come from (DB is 128)? should be a constant or loaded form DB - _logger.error('id: %s is to long (max: 64)', id) def get_id(self, xml_id): if xml_id is False or xml_id is None: From d7afa841690d48e61421581033844deb2ee1555a Mon Sep 17 00:00:00 2001 From: Thomas Binsfeld Date: Fri, 28 Apr 2017 12:07:07 +0200 Subject: [PATCH 2/5] [FIX] purchase: seller selection - Create an article with one supplierinfo (with a delivery delay and a min. quantity > 0) and a customer delivery delay - Trigger the creation of a PO by a procurement order for this article The supplier delivery delay is not taken into account in the date order of the PO because the seller is not selected. This is because the procurement quantity is not sent to the seller selection. opw-16702 Closes #16702 --- addons/purchase/purchase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 061fb804ab0..c28a979369a 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -817,7 +817,7 @@ class ProcurementOrder(models.Model): @api.v8 def _get_purchase_order_date(self, schedule_date): self.ensure_one() - seller_delay = int(self.product_id._select_seller(self.product_id).delay) + seller_delay = int(self.product_id._select_seller(product_id=self.product_id, quantity=self.product_qty).delay) return schedule_date - relativedelta(days=seller_delay) @api.v7 From 2c666af5d1d9eb49b04664ed871f932a34aa22cb Mon Sep 17 00:00:00 2001 From: Pierre Masereel Date: Thu, 4 May 2017 18:16:46 +0200 Subject: [PATCH 3/5] [FIX] mass_mailing: send mail to partner without email When you send a mass mailing to muiltiple partner, if some of them have no email adresse, it can lead to errors because of the variable 'recips' is not set if the first occurence in the 'for loop' has no email. To fix this, we always set the variable 'recips' by replacing the 'elif' close by a 'else' one introduced in rev: https://github.com/odoo/odoo/commit/65ed4553a50fdbefc986b7d21f87a81c42b743c7 --- addons/mass_mailing/wizard/mail_compose_message.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/mass_mailing/wizard/mail_compose_message.py b/addons/mass_mailing/wizard/mail_compose_message.py index 413415c9f5f..6c1fc81280e 100644 --- a/addons/mass_mailing/wizard/mail_compose_message.py +++ b/addons/mass_mailing/wizard/mail_compose_message.py @@ -61,8 +61,8 @@ class MailComposeMessage(models.TransientModel): mail_values = res[res_id] if mail_values.get('email_to'): recips = tools.email_split(mail_values['email_to']) - elif mail_values.get('recipient_ids') and partners_email.get(res_id): - recips = tools.email_split(partners_email[res_id]) + else: + recips = tools.email_split(partners_email.get(res_id)) mail_to = recips[0].lower() if recips else False if (blacklist and mail_to in blacklist) or (seen_list and mail_to in seen_list): # prevent sending to blocked addresses that were included by mistake From 89ad23bc2d2a1c6f2f0f0e80817a575353708631 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Thu, 4 May 2017 14:22:04 +0200 Subject: [PATCH 4/5] [FIX] web: auto_search false and search view By default auto_search is set to `True` on window actions, this mean that for example on a list or kanban view the records will be searched on the view opening without any user action needed. Setting it to `False` disable this. Doing this had two drawbacks: - depending on race condition, the view could be displayed before the search view was loaded, - the code expected `active_search` to be present which was not the case in this instance. Before 151c9074 the second issue would not happen (active_search was set directly resolved if a search was not to be done) and this commit also wait for the search view being ready before showing the view. opw-741186 opw-741546 closes #16805 --- addons/web/static/src/js/view_manager.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/js/view_manager.js b/addons/web/static/src/js/view_manager.js index d23d68d0f93..78399dd4a7d 100644 --- a/addons/web/static/src/js/view_manager.js +++ b/addons/web/static/src/js/view_manager.js @@ -149,16 +149,22 @@ var ViewManager = Widget.extend(ControlPanelMixin, { view.created = this.create_view.bind(this)(view, view_options); } + this.active_search = $.Deferred(); // Call do_search on the searchview to compute domains, contexts and groupbys if (this.search_view_loaded && this.flags.auto_search && view.controller.searchable !== false) { - this.active_search = $.Deferred(); $.when(this.search_view_loaded, view.created).done(function() { self.searchview.do_search(); }); + } else { + this.active_search.resolve(); } - var switched = $.when(view.created, this.active_search).then(function () { + var switched = $.when( + view.created, + this.search_view_loaded, + this.active_search + ).then(function () { return self._display_view(view_options, old_view).then(function () { self.trigger('switch_mode', view_type, no_store, view_options); }); From e3081dbb7e4274279a898d80ad77d6b461a80a71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Maes?= Date: Fri, 5 May 2017 13:57:30 +0200 Subject: [PATCH 5/5] [FIX] ir_cron: log message in the right place Log message in except clause to force displaying traceback in logger exception. Courtesy of chs --- openerp/addons/base/ir/ir_cron.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/addons/base/ir/ir_cron.py b/openerp/addons/base/ir/ir_cron.py index 0131a3cae1c..3682da46e63 100644 --- a/openerp/addons/base/ir/ir_cron.py +++ b/openerp/addons/base/ir/ir_cron.py @@ -112,7 +112,6 @@ class ir_cron(osv.osv): """ cr.rollback() - _logger.exception("Call of self.pool.get('%s').%s(cr, uid, *%r) failed in Job %s" % (model_name, method_name, args, job_id)) def _callback(self, cr, uid, model_name, method_name, args, job_id): """ Run the method associated to a given job @@ -147,6 +146,7 @@ class ir_cron(osv.osv): msg = "Model `%s` does not exist." % model_name _logger.warning(msg) except Exception, e: + _logger.exception("Call of self.pool.get('%s').%s(cr, uid, *%r) failed in Job %s" % (model_name, method_name, args, job_id)) self._handle_callback_exception(cr, uid, model_name, method_name, args, job_id, e) def _process_job(self, job_cr, job, cron_cr):