From d7afa841690d48e61421581033844deb2ee1555a Mon Sep 17 00:00:00 2001 From: Thomas Binsfeld Date: Fri, 28 Apr 2017 12:07:07 +0200 Subject: [PATCH 1/3] [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 89ad23bc2d2a1c6f2f0f0e80817a575353708631 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Thu, 4 May 2017 14:22:04 +0200 Subject: [PATCH 2/3] [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 3/3] [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):