From 3a2939d494d9270b5246de5af5f77480a6505170 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Thu, 18 Oct 2018 12:20:34 +0200 Subject: [PATCH 01/25] [FIX] web_editor: disable strange resize handles on Firefox See comments in the code for details... Closes https://github.com/odoo/odoo/pull/27964 --- addons/web_editor/static/src/js/rte.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/web_editor/static/src/js/rte.js b/addons/web_editor/static/src/js/rte.js index da2c2acd5e0..940d8482341 100644 --- a/addons/web_editor/static/src/js/rte.js +++ b/addons/web_editor/static/src/js/rte.js @@ -518,6 +518,14 @@ var RTE = Widget.extend({ return; } + // Removes strange _moz_abspos attribute when it appears. Cannot + // find another solution which works in all cases. A grabber still + // appears at the same time which I did not manage to remove. + // TODO find a complete and better solution + _.defer(function () { + $editable.find('[_moz_abspos]').removeAttr('_moz_abspos'); + }); + if ($target.is('a')) { /** * Remove content editable everywhere and add it on the link only so that characters can be added From 22f0da809e84618901b7ca4b78582abd64c03c55 Mon Sep 17 00:00:00 2001 From: Olivier Colson Date: Fri, 19 Oct 2018 15:04:12 +0200 Subject: [PATCH 02/25] [IMP] account: Trigger a validation error when trying to set the same currency on a journal as on its parent company. Until v12, doing this is wrong. The currency_id field of account.journal should only be used if the journal is in a different currency. Otherwise, this field should stay empty. //NOTE FOR FORWARD-PORT: this commit should not be ported to 12.0 and further. --- addons/account/i18n/account.pot | 5 +++++ addons/account/models/account.py | 2 ++ 2 files changed, 7 insertions(+) diff --git a/addons/account/i18n/account.pot b/addons/account/i18n/account.pot index 8b3c1c4f6cc..657f2638631 100644 --- a/addons/account/i18n/account.pot +++ b/addons/account/i18n/account.pot @@ -10051,3 +10051,8 @@ msgstr "" msgid "→ Count" msgstr "" +#. module: account +#: code:addons/account/models/account.py:309 +#, python-format +msgid "Currency field should only be set if the journal's currency is different from the company's. Leave the field blank to use company currency." +msgstr "" diff --git a/addons/account/models/account.py b/addons/account/models/account.py index 1eedaf8437c..f8f1303277c 100644 --- a/addons/account/models/account.py +++ b/addons/account/models/account.py @@ -305,6 +305,8 @@ class AccountJournal(models.Model): @api.constrains('currency_id', 'default_credit_account_id', 'default_debit_account_id') def _check_currency(self): if self.currency_id: + if self.currency_id == self.company_id.currency_id: + raise ValidationError(_("Currency field should only be set if the journal's currency is different from the company's. Leave the field blank to use company currency.")) if self.default_credit_account_id and not self.default_credit_account_id.currency_id.id == self.currency_id.id: raise ValidationError(_('Configuration error!\nThe currency of the journal should be the same than the default credit account.')) if self.default_debit_account_id and not self.default_debit_account_id.currency_id.id == self.currency_id.id: From 3008f7d254c95f200b9ca0e83eeee76557a9362a Mon Sep 17 00:00:00 2001 From: "Julien (juc) Castiaux" Date: Wed, 17 Oct 2018 14:01:21 +0200 Subject: [PATCH 03/25] [FIX] point_of_sale: Button spamming create duplicates Spamming the save button when creating a new custommer in point- of-sale create duplicate users. This PR disable the button once clicked and re-enable it when all the processing is done. opw-1895302 close #23919 --- addons/point_of_sale/static/src/js/screens.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index b37dc13ff95..8b1b001c340 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -1224,6 +1224,9 @@ var ClientListScreenWidget = ScreenWidget.extend({ fields.id = partner.id || false; fields.country_id = fields.country_id || false; + var contents = this.$(".client-details-contents"); + contents.off("click", ".button.save"); + new Model('res.partner').call('create_from_ui',[fields]).then(function(partner_id){ self.saved_client_details(partner_id); },function(err,event){ @@ -1237,6 +1240,7 @@ var ClientListScreenWidget = ScreenWidget.extend({ 'title': _t('Error: Could not Save Changes'), 'body': error_body, }); + contents.on('click','.button.save',function(){ self.save_client_details(partner); }); }); }, @@ -1254,6 +1258,8 @@ var ClientListScreenWidget = ScreenWidget.extend({ // has created, and reload_partner() must have loaded the newly created partner. self.display_client_details('hide'); } + }).always(function(){ + $(".client-details-contents").on('click','.button.save',function(){ self.save_client_details(partner); }); }); }, From 1ee180ee0dddb545f4d77247bc4e5d051a2a3a87 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 23 Oct 2018 15:46:09 +0200 Subject: [PATCH 04/25] [FIX] doc: do not duplicate header And use tabs instead of spaces Otherwise it looks for the file named "__manifest__.py 2014-..." --- doc/howtos/backend/exercise-report | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/doc/howtos/backend/exercise-report b/doc/howtos/backend/exercise-report index d3cbb2c0e49..c887829c145 100644 --- a/doc/howtos/backend/exercise-report +++ b/doc/howtos/backend/exercise-report @@ -3,8 +3,8 @@ Index: addons/openacademy/__manifest__.py =================================================================== ---- addons.orig/openacademy/__manifest__.py 2014-08-26 17:26:21.535783052 +0200 -+++ addons/openacademy/__manifest__.py 2014-08-26 17:26:21.531783052 +0200 +--- addons.orig/openacademy/__manifest__.py 2014-08-29 08:39:43.975536806 +0200 ++++ addons/openacademy/__manifest__.py 2014-08-29 08:39:52.000000000 +0200 @@ -21,7 +21,7 @@ 'version': '0.1', @@ -14,10 +14,6 @@ Index: addons/openacademy/__manifest__.py # always loaded 'data': [ -Index: addons/openacademy/__manifest__.py -=================================================================== ---- addons.orig/openacademy/__manifest__.py 2014-08-29 08:39:43.975536806 +0200 -+++ addons/openacademy/__manifest__.py 2014-08-29 08:39:52.000000000 +0200 @@ -31,6 +31,7 @@ 'views/openacademy.xml', 'views/partner.xml', From ef48b81ab127dd717a4a9d106edd5c51121bc8f7 Mon Sep 17 00:00:00 2001 From: Romain Derie Date: Mon, 15 Oct 2018 14:26:24 +0200 Subject: [PATCH 05/25] [FIX] website_sale: prevent other sessions to crash after checkout Before this commit: If an user has multiple session on a database (eg: he is connected both on his smartphone and his laptop on the ecommerce), and there is a cart in these session, confirming the cart on one of the session will make other sessions unable to use the checkout anymore. This is because other sessions will still contains the Sale Order that is now 'sent' and updating the cart will raise an error: `It is forbidden to modify a sales order which is not in draft status.` Now: If the SO to be updated is not in `draft` anymore, we create a new one. Step to reproduce: - Login on ecommerce from device A - Add product in cart, the SO will be added on session - Login on ecommerce from device B - Pay the cart (it will retrieve the SO from device A) - At that point, the cart is paid and the SO is removed from session on device B but other devices won't be able to use the checkout anymore as they still have the SO in session which is in `sent` state. Thus, any action on cart will raise the error Note: 1. We can't implement that behavior in `sale_get_order()` as it is supposed to return SO in `sent` state after checkout. 2. We can't implement that behavior in `_cart_update()` as it is inherited in some module. Thus, implementing that behavior in `cart_update()` would change `self = order` but inherited methods would still have initial `self`. 3. Implementing the behavior in the controller it is already done (differently) in `cart_update_json()`. Fixes #27508, closes #27794 --- addons/website_sale/controllers/main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/website_sale/controllers/main.py b/addons/website_sale/controllers/main.py index 5a576083582..5f7446fea99 100644 --- a/addons/website_sale/controllers/main.py +++ b/addons/website_sale/controllers/main.py @@ -370,7 +370,11 @@ class WebsiteSale(http.Controller): @http.route(['/shop/cart/update'], type='http', auth="public", methods=['POST'], website=True, csrf=False) def cart_update(self, product_id, add_qty=1, set_qty=0, **kw): - request.website.sale_get_order(force_create=1)._cart_update( + sale_order = request.website.sale_get_order(force_create=1) + if sale_order.state != 'draft': + request.session['sale_order_id'] = None + sale_order = request.website.sale_get_order(force_create=True) + sale_order._cart_update( product_id=int(product_id), add_qty=add_qty, set_qty=set_qty, From 27cc2ae3a91ad7a2fb16923256a359406e8bd68c Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 23 Oct 2018 15:53:50 +0200 Subject: [PATCH 06/25] [FIX] doc: backport of 9a07a4599ce to 10.0 To be compatible with sphinx >= 1.6 --- doc/_extensions/odoo_ext/__init__.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/_extensions/odoo_ext/__init__.py b/doc/_extensions/odoo_ext/__init__.py index 0ec55620497..c1637623e62 100644 --- a/doc/_extensions/odoo_ext/__init__.py +++ b/doc/_extensions/odoo_ext/__init__.py @@ -8,10 +8,13 @@ import sphinx.environment import sphinx.builders.html from docutils import nodes def setup(app): - if getattr(app.config, 'html_translator_class', None): - app.warn("Overriding the explicitly set html_translator_class setting", - location="odoo extension") - app.config.html_translator_class = 'odoo_ext.translator.BootstrapTranslator' + if hasattr(app, 'set_translator'): + app.set_translator('html', translator.BootstrapTranslator) + else: + if getattr(app.config, 'html_translator_class', None): + app.warn("Overriding the explicitly set html_translator_class setting", + location="odoo extension") + app.config.html_translator_class = 'odoo_ext.translator.BootstrapTranslator' switcher.setup(app) app.add_config_value('odoo_cover_default', None, 'env') From a0050c323cbbd43de016978406f7832b18ade161 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 23 Oct 2018 15:56:58 +0200 Subject: [PATCH 07/25] [FIX] doc: backport of ac37ca39eaf to 10.0 To be compatible with sphinx >= 1.8 --- doc/_extensions/github_link.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/_extensions/github_link.py b/doc/_extensions/github_link.py index cd0c5380621..b09177cf6e2 100644 --- a/doc/_extensions/github_link.py +++ b/doc/_extensions/github_link.py @@ -94,11 +94,12 @@ def add_doc_link(app, pagename, templatename, context, doctree): if not app.config.github_user and app.config.github_project: return - # FIXME: find other way to recover current document's source suffix - # in Sphinx 1.3 it's possible to have mutliple source suffixes and that - # may be useful in the future source_suffix = app.config.source_suffix - source_suffix = source_suffix if isinstance(source_suffix, basestring) else source_suffix[0] + # in 1.3 source_suffix can be a list + # in 1.8 source_suffix can be a mapping + # FIXME: will break if we ever add support for !rst markdown documents maybe + if not isinstance(source_suffix, basestring): + source_suffix = next(iter(source_suffix)) # can't use functools.partial because 3rd positional is line not mode context['github_link'] = lambda mode='edit': make_github_link( app, 'doc/%s%s' % (pagename, source_suffix), mode=mode) From d5cc05c9948c744f8f011250380cea20f9f859b2 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 23 Oct 2018 15:16:21 +0200 Subject: [PATCH 08/25] [FIX] doc: correct reference to the line in the file Introduced at 94e82753acc36 --- doc/reference/orm.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/reference/orm.rst b/doc/reference/orm.rst index bec009411b7..a8a95895b01 100644 --- a/doc/reference/orm.rst +++ b/doc/reference/orm.rst @@ -942,17 +942,17 @@ them (e.g. to change their default sort order): .. literalinclude:: ../../odoo/addons/test_documentation_examples/extension.py :language: python - :lines: 5- + :lines: 7- .. literalinclude:: ../../odoo/addons/test_documentation_examples/tests/test_extension.py :language: python - :lines: 8,13 + :lines: 10,15 will yield: .. literalinclude:: ../../odoo/addons/test_documentation_examples/tests/test_extension.py :language: text - :lines: 11 + :lines: 13 .. note:: it will also yield the various :ref:`automatic fields ` unless they've been disabled From c0e35f84e23ebda8ea6033711ded5638ef309da2 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Sun, 21 Oct 2018 00:04:37 +0200 Subject: [PATCH 09/25] [FIX] migration: use correct migration prefix in docstring Migration files must contain `-` in its name for being executed --- odoo/modules/migration.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/odoo/modules/migration.py b/odoo/modules/migration.py index 7f86b73a0da..78025cbfa11 100644 --- a/odoo/modules/migration.py +++ b/odoo/modules/migration.py @@ -25,8 +25,8 @@ class MigrationManager(object): function. Theses files must respect a directory tree structure: A 'migrations' folder which containt a folder by version. Version can be 'module' version or 'server.module' version (in this case, the files will only be processed by this version of the server). - Python file names must start by `pre` or `post` and will be executed, respectively, - before and after the module initialisation. `end` scripts are run after all modules have + Python file names must start by `pre-` or `post-` and will be executed, respectively, + before and after the module initialisation. `end-` scripts are run after all modules have been updated. Example: From 5d932e5db164fe80fd7c011ddd53f3494ef89ef5 Mon Sep 17 00:00:00 2001 From: "Julien (juc) Castiaux" Date: Tue, 23 Oct 2018 14:31:31 +0200 Subject: [PATCH 10/25] [FIX] delivery: wrong currency conversion In a multi-currency company, the delivery price of a quotation was wrongly converted when the currency used by the pricelist was not the same as the currency used by the company. This PR correct that behavior by correcly compute the delivery price according to the pricelist currency. To reproduce: 1) Install the accounting, sales and delivery modules 2) Set the company as a multi-currency company in the accounting settings 3) Change the currency rate so the one used by the company is 1 and the other one (the one that will be used on the pricelist) is anything else than 1 4) Create a pricelist with that other currency 5) Create a quotation using the new pricelist, select a deliver 6) Click "Set Price", the delivery price shown on the form isn't the same as the price on the quotation. opw-1894422 --- addons/delivery/models/sale_order.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/delivery/models/sale_order.py b/addons/delivery/models/sale_order.py index 4ee66daee85..601f104ff3c 100644 --- a/addons/delivery/models/sale_order.py +++ b/addons/delivery/models/sale_order.py @@ -23,7 +23,8 @@ class SaleOrder(models.Model): # Prevent SOAP call to external shipping provider when SO has no lines yet continue else: - order.delivery_price = order.carrier_id.with_context(order_id=order.id).price + order.delivery_price = order.company_id.currency_id.with_context(date=order.date_order).compute( + order.carrier_id.with_context(order_id=order.id).price, order.pricelist_id.currency_id) @api.onchange('partner_id') def onchange_partner_id_dtype(self): From 29e36457b29b9f8e919f58d246f734f44d8752b4 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Wed, 24 Oct 2018 11:57:42 +0200 Subject: [PATCH 11/25] [FIX] account: don't enforce test journal currency It was causing some tests failure due to 22f0da809e84618901b7ca4b78582abd64c03c55 --- addons/account/test/account_minimal_test.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/account/test/account_minimal_test.xml b/addons/account/test/account_minimal_test.xml index e127af9b289..5e1753efbfc 100644 --- a/addons/account/test/account_minimal_test.xml +++ b/addons/account/test/account_minimal_test.xml @@ -284,7 +284,6 @@ bank - From da08a9e98671ca8f2f0c963ad6793c58f1fa73be Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Wed, 24 Oct 2018 15:36:55 +0200 Subject: [PATCH 12/25] [FIX] base: don't ignore new uninstallable modules When updating the module list (`ir.module.module.update_list()`), new modules that are not installable were ignored. This behavior was not consistent with the database initialization [1] which creates all modules. [1] https://github.com/odoo/odoo/blob/5d932e5db164fe80fd7c011ddd53f3494ef89ef5/odoo/modules/db.py#L51-L54 --- odoo/addons/base/module/module.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/odoo/addons/base/module/module.py b/odoo/addons/base/module/module.py index 55cbb2d4be0..4145389ff7f 100644 --- a/odoo/addons/base/module/module.py +++ b/odoo/addons/base/module/module.py @@ -624,11 +624,10 @@ class Module(models.Model): mod.write(updated_values) else: mod_path = modules.get_module_path(mod_name) - if not mod_path: + if not mod_path or not terp: continue - if not terp or not terp.get('installable', True): - continue - mod = self.create(dict(name=mod_name, state='uninstalled', **values)) + state = "uninstalled" if terp.get('installable', True) else "uninstallable" + mod = self.create(dict(name=mod_name, state=state, **values)) res[1] += 1 mod._update_dependencies(terp.get('depends', [])) From 3f89774ed08d435a6374ec281b02d6135c706207 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20=C5=BDil=C4=97nas?= Date: Wed, 24 Oct 2018 17:15:02 +0300 Subject: [PATCH 13/25] [FIX] cli: fix broken link The master file no longer exists Closes odoo/odoo#26623 --- odoo/cli/templates/default/__manifest__.py.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/cli/templates/default/__manifest__.py.template b/odoo/cli/templates/default/__manifest__.py.template index 024d23c74d5..75fcd0aa3ac 100644 --- a/odoo/cli/templates/default/__manifest__.py.template +++ b/odoo/cli/templates/default/__manifest__.py.template @@ -14,7 +14,7 @@ 'website': "http://www.yourcompany.com", # Categories can be used to filter modules in modules listing - # Check https://github.com/odoo/odoo/blob/master/odoo/addons/base/module/module_data.xml + # Check https://github.com/odoo/odoo/blob/10.0/odoo/addons/base/module/module_data.xml # for the full list 'category': 'Uncategorized', 'version': '0.1', From 5f44f9a8431c05df9c6ebe807c0166742cf878d1 Mon Sep 17 00:00:00 2001 From: Anil Kesariya Date: Mon, 17 Sep 2018 14:50:54 +0530 Subject: [PATCH 14/25] [CLA] signature for AnilKesariya Closes odoo/odoo#27024 --- doc/cla/individual/anilkesariya.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 doc/cla/individual/anilkesariya.md diff --git a/doc/cla/individual/anilkesariya.md b/doc/cla/individual/anilkesariya.md new file mode 100644 index 00000000000..2b4158360eb --- /dev/null +++ b/doc/cla/individual/anilkesariya.md @@ -0,0 +1,12 @@ +India, 17, Sept - 2018 + +I hereby agree to the terms of the Odoo Individual Contributor License +Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this +declaration. + +Signed, + +Anil Kesariya anil.r.kesariya@gmail.com https://github.com/AnilKesariya + From d6a074b832e02649503b1151fd6f9096aaa4087d Mon Sep 17 00:00:00 2001 From: Luis Guzman Date: Wed, 24 Oct 2018 16:56:14 -0500 Subject: [PATCH 15/25] [CLA] signature for Ark74 Closes #28126 --- doc/cla/individual/ark74.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 doc/cla/individual/ark74.md diff --git a/doc/cla/individual/ark74.md b/doc/cla/individual/ark74.md new file mode 100644 index 00000000000..e729859d95f --- /dev/null +++ b/doc/cla/individual/ark74.md @@ -0,0 +1,11 @@ +Mexico, 2018-10-24 + +I hereby agree to the terms of the Odoo Individual Contributor License +Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this +declaration. + +Signed, + +Luis Guzman ark@switnet.org https://github.com/ark74 From 71cb425d0004fe6aff283b5ddfef704f167f88db Mon Sep 17 00:00:00 2001 From: xmo-odoo Date: Thu, 25 Oct 2018 11:08:35 +0200 Subject: [PATCH 16/25] [FIX] doc: translator under Sphinx 1.5 In Sphinx 1.5 (fairly specifically), the warner thing takes a `type` kw, and building the doc blows up if that parameter is not provided. --- doc/_extensions/odoo_ext/translator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/_extensions/odoo_ext/translator.py b/doc/_extensions/odoo_ext/translator.py index 48c5e901f28..f466b9ad6d0 100644 --- a/doc/_extensions/odoo_ext/translator.py +++ b/doc/_extensions/odoo_ext/translator.py @@ -196,7 +196,7 @@ class BootstrapTranslator(nodes.NodeVisitor, object): else: opts = {} - def warner(msg): + def warner(msg, **kw): self.builder.warn(msg, (self.builder.current_docname, node.line)) highlighted = self.builder.highlighter.highlight_block( node.rawsource, lang, opts=opts, warn=warner, linenos=linenos, From 8e63bcb47c72240f5d520f157b0ae5ffa291a714 Mon Sep 17 00:00:00 2001 From: Gert Pellin Date: Thu, 11 Oct 2018 13:44:55 +0200 Subject: [PATCH 17/25] [FIX] point_of_sale: IoT https in pos before this fix it was not possible to connect to the pos/iot-box using https on the pos. By checking if the pos is http or https this is now possible after accepting the certificate. if https scanning for proxy is disabled, the user should always give a ip in the configuration --- addons/point_of_sale/static/src/js/chrome.js | 3 +++ addons/point_of_sale/static/src/js/devices.js | 19 ++++++++++------ addons/point_of_sale/static/src/js/models.js | 22 +++++++++++++------ 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/addons/point_of_sale/static/src/js/chrome.js b/addons/point_of_sale/static/src/js/chrome.js index 3c2bf4519a1..ee7e4d9d9de 100644 --- a/addons/point_of_sale/static/src/js/chrome.js +++ b/addons/point_of_sale/static/src/js/chrome.js @@ -630,6 +630,9 @@ 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/devices.js b/addons/point_of_sale/static/src/js/devices.js index e8bd95bc117..26371ff01f4 100644 --- a/addons/point_of_sale/static/src/js/devices.js +++ b/addons/point_of_sale/static/src/js/devices.js @@ -188,11 +188,15 @@ var ProxyDevice = core.Class.extend(core.mixins.PropertiesMixin,{ // try harder when we remember a good proxy url found_url = this.try_hard_to_connect(localStorage.hw_proxy_url, options) .then(null,function(){ - return self.find_proxy(options); + if (window.location.protocol != 'https:'){ + return self.find_proxy(options); + } }); }else{ // just find something quick - found_url = this.find_proxy(options); + if (window.location.protocol != 'https:'){ + found_url = this.find_proxy(options); + } } success = found_url.then(function(url){ @@ -244,16 +248,17 @@ var ProxyDevice = core.Class.extend(core.mixins.PropertiesMixin,{ // try several time to connect to a known proxy url try_hard_to_connect: function(url,options){ options = options || {}; - var port = ':' + (options.port || '8069'); + var protocol = window.location.protocol; + var port = ( !options.port && protocol == "https:") ? ':443' : ':' + (options.port || '8069'); this.set_connection_status('connecting'); if(url.indexOf('//') < 0){ - url = 'http://'+url; + url = protocol + '//' + url; } if(url.indexOf(':',5) < 0){ - url = url+port; + url = url + port; } // try real hard to connect to url, with a 1sec timeout and up to 'retries' retries @@ -269,11 +274,11 @@ var ProxyDevice = core.Class.extend(core.mixins.PropertiesMixin,{ .done(function(){ done.resolve(url); }) - .fail(function(){ + .fail(function(resp){ if(retries > 0){ try_real_hard_to_connect(url,retries-1,done); }else{ - done.reject(); + done.reject(resp.statusText, url); } }); return done; diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 8b938738e85..dd2eb8d9596 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -121,13 +121,21 @@ exports.PosModel = Backbone.Model.extend({ progress: function(prog){ self.chrome.loading_progress(prog); }, - }).then(function(){ - if(self.config.iface_scan_via_proxy){ - self.barcode_reader.connect_to_proxy(); - } - }).always(function(){ - done.resolve(); - }); + }).then( + function(){ + if(self.config.iface_scan_via_proxy){ + self.barcode_reader.connect_to_proxy(); + } + 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(); + } + }); return done; }, From bfbaa092688c6282ae8468ab0cb6bfc2fcdfc552 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 25 Oct 2018 11:46:21 +0200 Subject: [PATCH 18/25] [FIX] hr_attendance: allow multiple attendances If the search returns more than one result, the rendering of the message would crash (SingletonError when accessing check_in field value). Use the same order and limit as both search before and after Courtesy of David Tran Closes odoo/odoo#28055 --- addons/hr_attendance/models/hr_attendance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_attendance/models/hr_attendance.py b/addons/hr_attendance/models/hr_attendance.py index e8772aeba10..55fbcf9102e 100644 --- a/addons/hr_attendance/models/hr_attendance.py +++ b/addons/hr_attendance/models/hr_attendance.py @@ -81,7 +81,7 @@ class HrAttendance(models.Model): ('employee_id', '=', attendance.employee_id.id), ('check_out', '=', False), ('id', '!=', attendance.id), - ]) + ], order='check_in desc', limit=1) if no_check_out_attendances: raise exceptions.ValidationError(_("Cannot create new attendance record for %(empl_name)s, the employee hasn't checked out since %(datetime)s") % { 'empl_name': attendance.employee_id.name_related, From 299c6dd3b474272940904ddc7b8917475574e160 Mon Sep 17 00:00:00 2001 From: Gert Pellin Date: Wed, 17 Oct 2018 14:30:52 +0200 Subject: [PATCH 19/25] [FIX] point_of_sale: alignment note textarea before fix: in firefox the textarea of note modal has a overflow textarea can be expanded outside borders modal in all browsers closes #25199 closes #25215 issue 1895298 --- addons/point_of_sale/static/src/css/pos.css | 13 +++++++++++++ addons/point_of_sale/static/src/xml/pos.xml | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/css/pos.css b/addons/point_of_sale/static/src/css/pos.css index e76f3854340..0673494853c 100644 --- a/addons/point_of_sale/static/src/css/pos.css +++ b/addons/point_of_sale/static/src/css/pos.css @@ -2140,6 +2140,19 @@ td { font-family: 'Lato'; font-family: Lato; } +.pos .modal-dialog .popup-textinput{ + display: flex; + flex-direction: column; +} +.pos .modal-dialog .popup-textinput .title, +.pos .modal-dialog .popup-textinput .footer{ + flex: none; +} +.pos .modal-dialog .popup-textinput textarea{ + resize: none; + flex: auto; + margin: 0 20px 80px; +} .pos .popup .title { background: rgba(255,255,255,0.5); margin: 0; diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml index c6627159262..b3122705a2c 100644 --- a/addons/point_of_sale/static/src/xml/pos.xml +++ b/addons/point_of_sale/static/src/xml/pos.xml @@ -1076,7 +1076,7 @@