From 2d0bcce58c58c128626d298800ab42f390c993c3 Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Wed, 14 Feb 2018 14:16:46 +0100 Subject: [PATCH 1/6] [FIX] website_forum: allow to submit link Fix/Simplify previous regex that was wrong (eg: http:// instead of http:\/\/) --- addons/website_forum/static/src/js/website_forum.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_forum/static/src/js/website_forum.js b/addons/website_forum/static/src/js/website_forum.js index 6806781c594..0d688f081c9 100644 --- a/addons/website_forum/static/src/js/website_forum.js +++ b/addons/website_forum/static/src/js/website_forum.js @@ -223,7 +223,7 @@ if(!$('.website_forum').length) { if (url.search("^http(s?)://.*")) { url = 'http://'+url; } - var regex = new RegExp("(http(s)?://.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)"); + var regex = new RegExp("^(http(s?):\/\/).*[\.]+.*"); if(regex.test(url)){ ajax.jsonRpc("/forum/get_url_title", 'call', {'url': url}).then(function (data) { if (data) { From 962af4b7807090af9a28cca295fb3b9b98a4cea6 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Wed, 14 Feb 2018 19:15:02 +0100 Subject: [PATCH 2/6] [FIX] mail: make List-Id header RFC2919 compliant Fixes the header initially introduced in f62f58174baffe8d24787ced02ccb8cc07954b6b See also https://tools.ietf.org/html/rfc2919#section-3 Fixes #18408 --- addons/mail/models/mail_channel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/models/mail_channel.py b/addons/mail/models/mail_channel.py index e2a99d350ba..91610463e81 100644 --- a/addons/mail/models/mail_channel.py +++ b/addons/mail/models/mail_channel.py @@ -186,7 +186,7 @@ class Channel(models.Model): # http://blogs.technet.com/b/exchange/archive/2006/10/06/3395024.aspx headers['X-Auto-Response-Suppress'] = 'OOF' if self.alias_domain and self.alias_name: - headers['List-Id'] = '%s.%s' % (self.alias_name, self.alias_domain) + headers['List-Id'] = '<%s.%s>' % (self.alias_name, self.alias_domain) headers['List-Post'] = '' % (self.alias_name, self.alias_domain) # Avoid users thinking it was a personal message # X-Forge-To: will replace To: after SMTP envelope is determined by ir.mail.server From 16050869435604085e566679863573e6cf0aa187 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Wed, 14 Feb 2018 19:22:34 +0100 Subject: [PATCH 3/6] [FIX] reqs.txt: bump up recommended Pillow version We should normally stick as close as possible to the version we depend on in the official DEB packages. This in turn depends on the version of Debian stable at the time of release - for 9.0 that would be Debian 8 (jessie) and thus Pillow 2.6.1. However Pillow versions before 3.1.1 suffer from a few issues that could lead to crashes of Odoo workers. The bugfixes have been backported in the DEB packages for Pillow, so users of Debian/Ubuntu LTS versions won't be affected if they are keeing their systems updated. However it's worth an exception to our rule for pip users. FWD-PORTS: skip --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index c41bdd57917..92be4fcd468 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ Babel==1.3 Jinja2==2.7.3 Mako==1.0.1 MarkupSafe==0.23 -Pillow==2.7.0 +Pillow==3.1.1 Python-Chart==1.39 PyYAML==3.11 Werkzeug==0.9.6 From 840c3be7b5b960d9aa67d6521905e8606d2504f8 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Wed, 14 Feb 2018 15:04:12 +0100 Subject: [PATCH 4/6] [FIX] point_of_sale: display python except message on partner creation Having base_vat installed (but is potentially more general than this) In the pos frontend, try to save a partner with an incorrect VAT Before this commit, the generic and cryptic message "your internet is probably down" was displayed to the user when a python exception occured After this commit, we display the exception's message OPW 807656 --- addons/point_of_sale/static/src/js/screens.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 140675e0b16..8b28025a2c7 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -1177,9 +1177,14 @@ var ClientListScreenWidget = ScreenWidget.extend({ self.saved_client_details(partner_id); },function(err,event){ event.preventDefault(); + var error_body = _t('Your Internet connection is probably down.'); + if (err.data) { + var except = err.data; + error_body = except.arguments && except.arguments[0] || except.message || error_body; + } self.gui.show_popup('error',{ 'title': _t('Error: Could not Save Changes'), - 'body': _t('Your Internet connection is probably down.'), + 'body': error_body, }); }); }, From c1276c154eae4d6f29d692d75b31d8045d04278d Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Wed, 14 Feb 2018 17:47:23 +0100 Subject: [PATCH 5/6] [FIX] point_of_sale: flattening only group of taxes when creating amls Revision 89c63096cb95f10f8bb3770e10d330aa904ac159 fixed the creation of the taxes applied to account move lines when validating a pos session The fix though overlooked two things: - protection against recursivity (nothing prevents a group of taxes to have a grand-parent as one of its children) - the fact that when converting a group of taxes into a regular computed one, the field children_ids is never reset Those two caveats provoked a "max recursivity error" in python within the right conditions This commit protects the recursive process from the two issues, and there is no traceback OPW 816163 --- addons/point_of_sale/models/pos_order.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/addons/point_of_sale/models/pos_order.py b/addons/point_of_sale/models/pos_order.py index 9ac6ed90ea8..13f6b90d706 100644 --- a/addons/point_of_sale/models/pos_order.py +++ b/addons/point_of_sale/models/pos_order.py @@ -197,10 +197,14 @@ class PosOrder(models.Model): return InvoiceLine.sudo().create(inv_line) def _create_account_move_line(self, session=None, move=None): - def _flatten_tax_and_children(taxes): + def _flatten_tax_and_children(taxes, group_done=None): children = self.env['account.tax'] - for tax in taxes: - children |= _flatten_tax_and_children(tax.children_tax_ids) + if group_done is None: + group_done = set() + for tax in taxes.filtered(lambda t: t.amount_type == 'group'): + if tax.id not in group_done: + group_done.add(tax.id) + children |= _flatten_tax_and_children(tax.children_tax_ids, group_done) return taxes + children # Tricky, via the workflow, we only have one id in the ids variable From 9a67c8b94665a394f452795d6c47984869a7af00 Mon Sep 17 00:00:00 2001 From: Florent de Labarre Date: Mon, 29 Jan 2018 20:02:28 +0100 Subject: [PATCH 6/6] [FIX] stock: UserError message improvement To know the product still having some active reordering rules. Closes #22615 opw:813476 --- addons/stock/models/product.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/addons/stock/models/product.py b/addons/stock/models/product.py index 2a0e96f58dd..3d19c83be64 100644 --- a/addons/stock/models/product.py +++ b/addons/stock/models/product.py @@ -371,8 +371,14 @@ class Product(models.Model): @api.multi def write(self, values): res = super(Product, self).write(values) - if 'active' in values and not values['active'] and self.mapped('orderpoint_ids').filtered(lambda r: r.active): - raise UserError(_('You still have some active reordering rules on this product. Please archive or delete them first.')) + if 'active' in values and not values['active']: + products = self.mapped('orderpoint_ids').filtered(lambda r: r.active).mapped('product_id') + if products: + msg = _('You still have some active reordering rules on this product. Please archive or delete them first.') + msg += '\n\n' + for product in products: + msg += '- %s \n' % product.display_name + raise UserError(msg) return res class ProductTemplate(models.Model):