From 9fc21c9b61b13e19533557656735f3d303201b26 Mon Sep 17 00:00:00 2001 From: Jigar Vaghela Date: Wed, 3 Apr 2019 05:01:06 +0000 Subject: [PATCH 1/5] [FIX] l10n_pl: incorrect command The `(6,0,[*])` command is missing from `vs_kraj_7`. closes odoo/odoo#32358 Signed-off-by: Nicolas Martinelli (nim) --- addons/l10n_pl/data/account_tax_data.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/l10n_pl/data/account_tax_data.xml b/addons/l10n_pl/data/account_tax_data.xml index a4fece19af2..5173dfde702 100644 --- a/addons/l10n_pl/data/account_tax_data.xml +++ b/addons/l10n_pl/data/account_tax_data.xml @@ -253,7 +253,7 @@ sale - + From 9f2dd49c57f70f0ee1651aa19637f6c2e35cae8f Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Tue, 2 Apr 2019 08:33:15 +0000 Subject: [PATCH 2/5] [FIX] product, purchase: seller in multi-company - Create 2 companies A & B - For a product P, create a supplier info for each company using the same partner, with a different price and delay. - Order the supplier so that the one for A has a higher priority than the one for B. - Create a reordering rule for P in company B. - Run the scheduler as admin (e.g. thanks to the cron). The price taken is the price for company A instead of B. `_select_seller` is not company-aware, therefore the first matching supplier is chosen. opw-1959263 closes odoo/odoo#32328 Signed-off-by: Nicolas Martinelli (nim) --- addons/product/models/product.py | 5 ++++- addons/purchase/models/purchase.py | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/addons/product/models/product.py b/addons/product/models/product.py index ecf48deeb33..dba77cc1937 100644 --- a/addons/product/models/product.py +++ b/addons/product/models/product.py @@ -516,7 +516,10 @@ class ProductProduct(models.Model): if date is None: date = fields.Date.today() res = self.env['product.supplierinfo'] - for seller in self.seller_ids: + sellers = self.seller_ids + if self.env.context.get('force_company'): + sellers = sellers.filtered(lambda s: not s.company_id or s.company_id.id == self.env.context['force_company']) + for seller in sellers: # Set quantity in UoM of seller quantity_uom_seller = quantity if quantity_uom_seller and uom_id and uom_id != seller.product_uom: diff --git a/addons/purchase/models/purchase.py b/addons/purchase/models/purchase.py index 8f80e112b32..efab0354cbf 100644 --- a/addons/purchase/models/purchase.py +++ b/addons/purchase/models/purchase.py @@ -958,7 +958,11 @@ class ProcurementOrder(models.Model): """Return the datetime value to use as Order Date (``date_order``) for the Purchase Order created to satisfy the given procurement. """ self.ensure_one() - seller_delay = int(self.product_id._select_seller(quantity=self.product_qty, uom_id=self.product_uom).delay) + seller_delay = int( + self.product_id.with_context(force_company=self.company_id.id)._select_seller( + quantity=self.product_qty, uom_id=self.product_uom + ).delay + ) return schedule_date - relativedelta(days=seller_delay) @api.multi @@ -966,7 +970,7 @@ class ProcurementOrder(models.Model): self.ensure_one() procurement_uom_po_qty = self.product_uom._compute_quantity(self.product_qty, self.product_id.uom_po_id) - seller = self.product_id._select_seller( + seller = self.product_id.with_context(force_company=self.company_id.id)._select_seller( partner_id=supplier.name, quantity=procurement_uom_po_qty, date=po.date_order and po.date_order[:10], From e14c386a19a182127fe7993aae19f601587f83b9 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Mon, 1 Apr 2019 13:00:44 +0000 Subject: [PATCH 3/5] [FIX] point_of_sale: allow connect proxy https error Since 79af654fc61 if we had unexpected configuration of usage such as being in HTTPS, having a POS hardware in HTTPS but an error is received (eg. the device is closed) => the POS interface can't be opened being blocked on an error: Https connection to IoT Box failed Make sure you are using IoT Box v18.10 or higher. Navigate to {proxy_ip} to accept the certificate of your IoT Box. With this changeset, we have a popup that does not prevent to open the point of sale interface (and the red disconnected status in the top left allow to retry connection as before) on first load. opw-1934413 closes #32306 Signed-off-by: Nicolas Lempereur (nle) --- addons/point_of_sale/i18n/point_of_sale.pot | 14 ++++++++++++++ addons/point_of_sale/static/src/js/chrome.js | 3 --- addons/point_of_sale/static/src/js/models.js | 15 ++++++++++----- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/addons/point_of_sale/i18n/point_of_sale.pot b/addons/point_of_sale/i18n/point_of_sale.pot index dbf186e92ce..c364646d4e0 100644 --- a/addons/point_of_sale/i18n/point_of_sale.pot +++ b/addons/point_of_sale/i18n/point_of_sale.pot @@ -1267,6 +1267,13 @@ msgstr "" msgid "Group Journal Items" msgstr "" +#. module: point_of_sale +#. openerp-web +#: code:addons/point_of_sale/static/src/js/models.js:135 +#, python-format +msgid "HTTPS connection to IoT Box failed" +msgstr "" + #. module: point_of_sale #. openerp-web #: code:addons/point_of_sale/static/src/xml/pos.xml:1322 @@ -1594,6 +1601,13 @@ msgstr "" msgid "Make Payment" msgstr "" +#. module: point_of_sale +#. openerp-web +#: code:addons/point_of_sale/static/src/js/models.js:137 +#, python-format +msgid "Make sure you are using IoT Box v18.12 or higher. Navigate to %s to accept the certificate of your IoT Box." +msgstr "" + #. module: point_of_sale #: model:ir.ui.view,arch_db:point_of_sale.view_sale_config_settings_form_pos msgid "Manage loyalty program with points and rewards for customers" diff --git a/addons/point_of_sale/static/src/js/chrome.js b/addons/point_of_sale/static/src/js/chrome.js index ee7e4d9d9de..3c2bf4519a1 100644 --- a/addons/point_of_sale/static/src/js/chrome.js +++ b/addons/point_of_sale/static/src/js/chrome.js @@ -630,9 +630,6 @@ var Chrome = PosBaseWidget.extend({ if(err.message === 'XmlHttpRequestError '){ title = 'Network Failure (XmlHttpRequestError)'; body = 'The Point of Sale could not be loaded due to a network problem.\n Please check your internet connection.'; - }else if(err.message === 'TLSError'){ - title = 'Https connection to IoT Box failed'; - body = 'Make sure you are using IoT Box v18.10 or higher.\n\n Navigate to ' + err.url + ' to accept the certificate of your IoT Box.'; }else if(err.code === 200){ title = err.data.message; body = err.data.debug; diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 2fe1efe8bfa..5e00712be0d 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -129,11 +129,16 @@ exports.PosModel = Backbone.Model.extend({ done.resolve(); }, function(statusText, url){ - if (statusText == 'error' && window.location.protocol == 'https:') { - var error = {message: 'TLSError', url: url}; - self.chrome.loading_error(error); - } else { - done.resolve(); + var show_loading_error = (self.gui.current_screen === null); + done.resolve(); + if (show_loading_error && statusText == 'error' && window.location.protocol == 'https:') { + self.gui.show_popup('alert', { + title: _t('HTTPS connection to IoT Box failed'), + body: _.str.sprintf( + _t('Make sure you are using IoT Box v18.12 or higher. Navigate to %s to accept the certificate of your IoT Box.'), + url + ), + }); } }); return done; From 94d15e037c33ce81133b9be8d6eaf5819608d9d2 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 3 Apr 2019 13:20:19 +0000 Subject: [PATCH 4/5] [FIX] account_set: Wrong recomputation of the depreciation lines When a asset is confirmed, it's not allowed to link it to an invoice. Side effect, it recomputed the depreciation lines of the confirmed asset. opw:1961468 closes odoo/odoo#32388 Signed-off-by: Simon Goffin (sig) --- addons/account_asset/views/account_asset_views.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_asset/views/account_asset_views.xml b/addons/account_asset/views/account_asset_views.xml index 6689500c0ac..2c316483e38 100644 --- a/addons/account_asset/views/account_asset_views.xml +++ b/addons/account_asset/views/account_asset_views.xml @@ -133,7 +133,7 @@ - + From 60592561d71cc4a216b1bcafa3169f3b27af61f8 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Tue, 2 Apr 2019 10:01:11 +0000 Subject: [PATCH 5/5] [FIX] web_editor: support youtube-nocookie.com closes odoo/odoo#32332 Signed-off-by: Quentin Smetz (qsm) --- addons/web_editor/static/src/js/widgets.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/web_editor/static/src/js/widgets.js b/addons/web_editor/static/src/js/widgets.js index a3a990a7baf..ddf94e147a7 100644 --- a/addons/web_editor/static/src/js/widgets.js +++ b/addons/web_editor/static/src/js/widgets.js @@ -769,7 +769,7 @@ function createVideoNode(url, options) { options = options || {}; // video url patterns(youtube, instagram, vimeo, dailymotion, youku) - var ytRegExp = /^(?:(?:https?:)?\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/; + var ytRegExp = /^(?:(?:https?:)?\/\/)?(?:www\.)?(?:youtu\.be\/|youtube(-nocookie)?\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((?:\w|-){11})(?:\S+)?$/; var ytMatch = url.match(ytRegExp); var igRegExp = /\/\/instagram.com\/p\/(.[a-zA-Z0-9]*)/; @@ -788,10 +788,10 @@ function createVideoNode(url, options) { var youkuMatch = url.match(youkuRegExp); var $video = $('