From 160ddc8567c60493ea077033aa44e1f4139fec41 Mon Sep 17 00:00:00 2001 From: remi-filament <30716308+remi-filament@users.noreply.github.com> Date: Mon, 5 Feb 2018 20:21:45 +0100 Subject: [PATCH 1/8] [FIX] web_editor: correct check of property 'rules' Port of PR #22603 from v9 to v10 See Issue #22517 (#22679) --- addons/web_editor/static/src/js/transcoder.js | 2 +- doc/cla/individual/remi-filament.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web_editor/static/src/js/transcoder.js b/addons/web_editor/static/src/js/transcoder.js index 6b42e028b3a..265ca5ab3f0 100644 --- a/addons/web_editor/static/src/js/transcoder.js +++ b/addons/web_editor/static/src/js/transcoder.js @@ -9,7 +9,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. diff --git a/doc/cla/individual/remi-filament.md b/doc/cla/individual/remi-filament.md index b57242f471f..fb602974ade 100644 --- a/doc/cla/individual/remi-filament.md +++ b/doc/cla/individual/remi-filament.md @@ -8,4 +8,4 @@ declaration. Signed, -Rémi CAZENAVE remi@le-filament.com https://github.com/remi-filament +Rémi CAZENAVE 30716308+remi-filament@users.noreply.github.com https://github.com/remi-filament 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 2/8] [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 90ab699d9099fb7ff79202fb22663c5048b892e3 Mon Sep 17 00:00:00 2001 From: Wolfgang Taferner Date: Tue, 6 Feb 2018 08:13:23 +0100 Subject: [PATCH 3/8] [CLA] WT-IO-IT GmbH signature of Corporate CLA Closes #22825 --- doc/cla/corporate/wt-io-it.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 doc/cla/corporate/wt-io-it.md diff --git a/doc/cla/corporate/wt-io-it.md b/doc/cla/corporate/wt-io-it.md new file mode 100644 index 00000000000..491d580c792 --- /dev/null +++ b/doc/cla/corporate/wt-io-it.md @@ -0,0 +1,15 @@ +Austria, 2018-02-06 + +WT-IO-IT GmbH agrees to the terms of the Odoo Corporate Contributor License +Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this +declaration. + +Signed, + +Wolfgang Taferner wolfgang.taferner@wt-io-it.at https://github.com/wt-io-it + +List of contributors: + +Wolfgang Taferner wolfgang.taferner@wt-io-it.at https://github.com/wtaferner From d219963192b36ab43f9522244cadb9dcb11ab2fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miquel=20Ra=C3=AFch?= Date: Tue, 6 Feb 2018 08:16:19 +0100 Subject: [PATCH 4/8] [FIX] purchase_mrp: correct manifest Title underline was too shat, making the rendering crash Closes #21756 --- addons/purchase_mrp/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/purchase_mrp/__manifest__.py b/addons/purchase_mrp/__manifest__.py index 5fde90cfe08..ce84472e8d9 100644 --- a/addons/purchase_mrp/__manifest__.py +++ b/addons/purchase_mrp/__manifest__.py @@ -8,7 +8,7 @@ 'category': 'Hidden', 'description': """ This module provides facility to the user to install mrp and purchase modules at a time. -==================================================================================== +======================================================================================== It is basically used when we want to keep track of production orders generated from purchase order. From 34d2765faa0f64d1603264995e183a12b10273c0 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 6 Feb 2018 19:44:54 +0530 Subject: [PATCH 5/8] [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 6/8] [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'), From a93a9d43e6b383a8ade8395017110e49b80d48cd Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Wed, 7 Feb 2018 12:17:25 +0100 Subject: [PATCH 7/8] [FIX] website: allow "Customize theme" when CDN option enabled Traceback because the `_get_asset` function was called by the `theme_customize` route without the `values` argument (which is not necessary for the feature). Closes https://github.com/odoo/odoo/issues/22516 --- addons/website/models/ir_qweb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website/models/ir_qweb.py b/addons/website/models/ir_qweb.py index 4ecee90fd5e..f9a14d812e5 100644 --- a/addons/website/models/ir_qweb.py +++ b/addons/website/models/ir_qweb.py @@ -26,7 +26,7 @@ class QWeb(models.AbstractModel): def _get_asset(self, xmlid, options, css=True, js=True, debug=False, async=False, values=None): website = getattr(request, 'website', None) if request else None if website and website.cdn_activated: - values = dict(values, url_for=website.get_cdn_url) + values = dict(values or {}, url_for=website.get_cdn_url) return super(QWeb, self)._get_asset(xmlid, options, css, js, debug, async, values) def _website_build_attribute(self, tagName, name, value, options, values): From 66e76d681d41b6c007a0394b078ddbe872989985 Mon Sep 17 00:00:00 2001 From: Romain Derie Date: Wed, 7 Feb 2018 12:50:12 +0100 Subject: [PATCH 8/8] [FIX] payment_stripe: integer currencies (portal payment) Before this commit: On portal (My Account > Invoices > Pay Now), a stripe payment in a normal currency (eg: a non integer currency) would debit the amount *100. This comes from b335ae0348ac74b2edb6d5ea56cc230e276ef283 which added a workflow to handle integer currencies but it also sent the *100 amount to /website_payment/transaction that would create a TX with that amount instead of the normal amount. Now, the normal amount is correctly sent to the backend, the multiplied amount is just sent to StripeCheckout handler to correctly display the amount on the popup after clicking on "Pay Now". Note: the amount will be multiplied on the backend independently ecda057e1166ea1fa9afa4e5b954e5c99aa80232 --- addons/payment_stripe/static/src/js/stripe.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/addons/payment_stripe/static/src/js/stripe.js b/addons/payment_stripe/static/src/js/stripe.js index 9db27aea858..a5dec077e7d 100644 --- a/addons/payment_stripe/static/src/js/stripe.js +++ b/addons/payment_stripe/static/src/js/stripe.js @@ -70,9 +70,6 @@ odoo.define('payment_stripe.stripe', function(require) { var currency = $("input[name='currency']").val(); var currency_id = $("input[name='currency_id']").val(); var amount = parseFloat($("input[name='amount']").val() || '0.0'); - if (!_.contains(int_currencies, currency)) { - amount = amount*100; - } ajax.jsonRpc('/website_payment/transaction', 'call', { reference: $("input[name='invoice_num']").val(), @@ -84,14 +81,11 @@ odoo.define('payment_stripe.stripe', function(require) { name: $("input[name='merchant']").val(), description: $("input[name='invoice_num']").val(), currency: currency, - amount: amount, + amount: _.contains(int_currencies, currency) ? amount : amount * 100, }); } else { var currency = $("input[name='currency']").val(); var amount = parseFloat($("input[name='amount']").val() || '0.0'); - if (!_.contains(int_currencies, currency)) { - amount = amount*100; - } ajax.jsonRpc('/shop/payment/transaction/' + acquirer_id, 'call', { so_id: so_id, @@ -102,7 +96,7 @@ odoo.define('payment_stripe.stripe', function(require) { name: $("input[name='merchant']").val(), description: $("input[name='invoice_num']").val(), currency: currency, - amount: amount, + amount: _.contains(int_currencies, currency) ? amount : amount * 100, }); }); }