From a98beb13db82b692d32aa0e6e0b0befabbbaa386 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Mon, 5 Feb 2018 20:24:23 +0100 Subject: [PATCH 1/3] [FIX] web_editor: correct check of 'rules' property see issue #22517 --- addons/web_editor/static/src/js/transcoder.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/transcoder.js b/addons/web_editor/static/src/js/transcoder.js index ca6f751f954..b0831832dd6 100644 --- a/addons/web_editor/static/src/js/transcoder.js +++ b/addons/web_editor/static/src/js/transcoder.js @@ -13,7 +13,7 @@ var getMatchedCSSRules = function (a) { var sheets = document.styleSheets; for(var i = sheets.length-1; i >= 0 ; i--) { var rules; - if (sheets[i].rules) { + if (sheets[i].hasOwnProperty('rules')) { rules = sheets[i].rules; } else { //try...catch because Firefox not able to enumerate document.styleSheets[].cssRules[] for cross-domain stylesheets. From 34d2765faa0f64d1603264995e183a12b10273c0 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 6 Feb 2018 19:44:54 +0530 Subject: [PATCH 2/3] [FIX] crm: allow to unlink multiple records Closes #22647 --- addons/crm/models/crm_activity.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/addons/crm/models/crm_activity.py b/addons/crm/models/crm_activity.py index 46592fd9134..208d43a2c84 100644 --- a/addons/crm/models/crm_activity.py +++ b/addons/crm/models/crm_activity.py @@ -48,8 +48,9 @@ class CrmActivity(models.Model): @api.multi def unlink(self): - activities = self.search([('subtype_id', '=', self.subtype_id.id)]) - # to ensure that the subtype is only linked the current activity - if len(activities) == 1: - self.subtype_id.unlink() + for activity in self: + activities = self.search([('subtype_id', '=', activity.subtype_id.id)]) + # to ensure that the subtype is only linked the current activity + if len(activities) == 1: + activity.subtype_id.unlink() return super(CrmActivity, self).unlink() \ No newline at end of file From 80f88ad63b81c1f56aa22251abbfdbbd7d4ebe63 Mon Sep 17 00:00:00 2001 From: celm1990 Date: Mon, 15 Jan 2018 18:18:41 -0500 Subject: [PATCH 3/3] [FIX] point_of_sale: unmark order finalized when invoice failed When we validate an order that need to be invoiced, and the customer is not set, you have to enter a customer, but your order is finalized so you have a traceback saying it cannot be modified when you try to set the customer. When the invoicing fails, we don't set the order as finalized. --- addons/point_of_sale/static/src/js/screens.js | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 726231a9258..140675e0b16 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -1916,6 +1916,7 @@ var PaymentScreenWidget = ScreenWidget.extend({ invoiced.fail(function(error){ self.invoicing = false; + order.finalized = false; if (error.message === 'Missing Customer') { self.gui.show_popup('confirm',{ 'title': _t('Please select the Customer'),