From b85bd358234684974f9af63bc5f28cfabb527767 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Tue, 17 Oct 2017 11:11:34 +0200 Subject: [PATCH 01/18] [FIX] web_editor: fixed issue of chrome triple click Partial backport of 11.0 commit (https://github.com/odoo/odoo/commit/6ad2ae30354a77c0f898cb9cb5a859713061d71a) to solve issue 774152. Note: it has to be forward-ported as implementation has been improved to handle mass mailing cases. When an user triple-clicked on a paragraph and then typed text, the paragraph was removed instead of its content (so the new text was added at the beginning of the next paragraph). See: http://stackoverflow.com/questions/38467334/why-does-google-chrome-always-add-space-after-selected-text --- addons/web_editor/static/src/js/rte.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/addons/web_editor/static/src/js/rte.js b/addons/web_editor/static/src/js/rte.js index 8eef4cfe3a6..37b87553506 100644 --- a/addons/web_editor/static/src/js/rte.js +++ b/addons/web_editor/static/src/js/rte.js @@ -586,6 +586,28 @@ var RTE = Widget.extend({ setTimeout(function () { self.historyRecordUndo($target, 'activate', true); },0); + + // To Fix Google Chrome Tripleclick Issue, which selects the ending + // whitespace characters (so Tripleclicking then typing text will remove + // the whole paragraph instead of its content). + // http://stackoverflow.com/questions/38467334/why-does-google-chrome-always-add-space-after-selected-text + if ($.browser.chrome === true && event.originalEvent.detail === 3) { + var currentSelection = range.create(); + if (currentSelection.sc.parentNode === currentSelection.ec) { + _selectSC(currentSelection); + } else if (currentSelection.eo === 0) { + var $hasNext = $(currentSelection.sc).parent(); + while (!$hasNext.next().length && !$hasNext.is('body')) { + $hasNext = $hasNext.parent(); + } + if ($hasNext.next()[0] === currentSelection.ec) { + _selectSC(currentSelection); + } + } + } + function _selectSC(selection) { + range.create(selection.sc, selection.so, selection.sc, selection.sc.length).select(); + } }, editable: function () { From 9ae78328ec6fa0c1ba5c0a5f7583a565c7fa4e3f Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Thu, 31 Aug 2017 14:38:23 +0200 Subject: [PATCH 02/18] [FIX] fields: writing on a one2many with a domain should not remove all lines Specifically, the command `(6, 0, ids)` should only unlink/detach the lines that satisfy to the field's domain. Test from #18440 opw-756983 Closes #18438 Closes #18440 --- .../test_new_api/tests/test_new_fields.py | 24 +++++++++++++++++++ openerp/osv/fields.py | 9 +++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/openerp/addons/test_new_api/tests/test_new_fields.py b/openerp/addons/test_new_api/tests/test_new_fields.py index fe118ba44ca..6ac223bd458 100644 --- a/openerp/addons/test_new_api/tests/test_new_fields.py +++ b/openerp/addons/test_new_api/tests/test_new_fields.py @@ -528,6 +528,30 @@ class TestNewFields(common.TransactionCase): self.assertFalse(discussion.very_important_messages) self.assertFalse(message.exists()) + def test_70_x2many_write(self): + discussion = self.env.ref('test_new_api.discussion_0') + Message = self.env['test_new_api.message'] + # There must be 3 messages, 0 important + self.assertEqual(len(discussion.messages), 3) + self.assertEqual(len(discussion.important_messages), 0) + self.assertEqual(len(discussion.very_important_messages), 0) + discussion.important_messages = [(0, 0, { + 'body': 'What is the answer?', + 'important': True, + })] + # There must be 4 messages, 1 important + self.assertEqual(len(discussion.messages), 4) + self.assertEqual(len(discussion.important_messages), 1) + self.assertEqual(len(discussion.very_important_messages), 1) + discussion.very_important_messages |= Message.new({ + 'body': '42', + 'important': True, + }) + # There must be 5 messages, 2 important + self.assertEqual(len(discussion.messages), 5) + self.assertEqual(len(discussion.important_messages), 2) + self.assertEqual(len(discussion.very_important_messages), 2) + class TestMagicFields(common.TransactionCase): diff --git a/openerp/osv/fields.py b/openerp/osv/fields.py index b451da449e6..99a51c4e79b 100644 --- a/openerp/osv/fields.py +++ b/openerp/osv/fields.py @@ -861,8 +861,13 @@ class one2many(_column): # Must use write() to recompute parent_store structure if needed obj.write(cr, user, act[2], {self._fields_id:id}, context=context or {}) ids2 = act[2] or [0] - cr.execute('select id from '+_table+' where '+self._fields_id+'=%s and id <> ALL (%s)', (id,ids2)) - ids3 = map(lambda x:x[0], cr.fetchall()) + # if the o2m has a static domain we must respect it when unlinking + domain = (self._domain(original_obj) + if callable(self._domain) else self._domain) + extra_domain = domain or [] + ids3 = obj.search(cr, user, [(self._fields_id,'=',id), ('id','not in',ids2)] + extra_domain, context=context) + # If the model has cascade deletion, we delete the rows because it is the intended behavior, + # otherwise we only nullify the reverse foreign key column. inverse_field = obj._fields.get(self._fields_id) if getattr(inverse_field, "ondelete", None) == "cascade": obj.unlink(cr, user, ids3, context=context) From 539a09a93ca9776c589f890d31bf132d5ed87dc4 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Mon, 16 Oct 2017 08:42:06 +0200 Subject: [PATCH 03/18] [FIX] stock: use method return In case MRP is used with kits (phantom BOMs), the method `action_explode` is called through the override of `action_confirm`. However, `action_explode` modifies the recordset by deleting the move with the original product since it is not relevant anymore. We take this use case into account by reusing the return value of `action_confirm`. opw-772644 --- addons/stock/models/stock_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py index 30c988954d7..3c359c93b25 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -971,7 +971,7 @@ class StockMove(models.Model): self._propagate_split(new_move, qty) # returning the first element of list returned by action_confirm is ok because we checked it wouldn't be exploded (and # thus the result of action_confirm should always be a list of 1 element length) - new_move.action_confirm() + new_move = new_move.action_confirm() # TDE FIXME: due to action confirm change return new_move.id From a48b5c45aa8abef24da31104187399702533d1fe Mon Sep 17 00:00:00 2001 From: alexkuhn Date: Tue, 17 Oct 2017 14:20:30 +0200 Subject: [PATCH 04/18] [FIX] crm: stage auto-probability not taken into account when creating an opportunity from kanban view (#20209) 1. on CRM module -> Select Pipeline -> Create a column (e.g. 'Test') 2. Edit this Stage 3. Toggle on the field 'Change Probability Automatically' 4. Set a stage probability (e.g. 50%) 5. Create an opportunity on this stage, using the quick create widget of the kanban view => The probability of the newly created opportunity is not 50%, as it should be expected It takes the default_probability, using a default_stage_id, which is the 'New' column having initially a probability of 10%. The stage_id is correctly assigned to the newly created opportunity thanks to environment variable 'default_stage_id', but not the probability. We solved this bug by updating the probability of the opportunity, after creating the object. We cannot do it at the same time, because BaseObject.create parse the missing fields in an order where probability comes before stage_id. This fix is limited to the quick creation of opportunity by means of its name only. In particular, it doesn't overwrite the input of the user in the form view. opw-772310 --- addons/crm/models/crm_lead.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/crm/models/crm_lead.py b/addons/crm/models/crm_lead.py index 5a506b0da20..879350cf55d 100644 --- a/addons/crm/models/crm_lead.py +++ b/addons/crm/models/crm_lead.py @@ -282,6 +282,14 @@ class Lead(FormatAddress, models.Model): # ORM override (CRUD, fields_view_get, ...) # ---------------------------------------- + @api.model + def name_create(self, name): + res = super(Lead, self).name_create(name) + + # update the probability of the lead if the stage is set to update it automatically + self.browse(res[0])._onchange_stage_id() + return res + @api.model def create(self, vals): # set up context used to find the lead's sales team which is needed From 4d56e76d52388e1ac8378cfd6eeff393d905364e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agathe=20Moll=C3=A9?= Date: Tue, 17 Oct 2017 10:18:13 -0400 Subject: [PATCH 05/18] [FIX] Fix canadian province state_ca_NL name --- odoo/addons/base/res/res.country.state.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/addons/base/res/res.country.state.csv b/odoo/addons/base/res/res.country.state.csv index 1f8379f864d..a9f72ee3ae3 100644 --- a/odoo/addons/base/res/res.country.state.csv +++ b/odoo/addons/base/res/res.country.state.csv @@ -534,7 +534,7 @@ state_ca_ab,ca,"Alberta","AB" state_ca_bc,ca,"British Columbia","BC" state_ca_mb,ca,"Manitoba","MB" state_ca_nb,ca,"New Brunswick","NB" -state_ca_nl,ca,"Newfoundland","NL" +state_ca_nl,ca,"Newfoundland and Labrador","NL" state_ca_nt,ca,"Northwest Territories","NT" state_ca_ns,ca,"Nova Scotia","NS" state_ca_nu,ca,"Nunavut","NU" From 6e46ba7b460b5f155735c91f957a4dca3dec8f96 Mon Sep 17 00:00:00 2001 From: Laurent Smet Date: Tue, 17 Oct 2017 15:19:31 +0200 Subject: [PATCH 06/18] [FIX] point_of_sale: fix taxes rounding in POS Don't round the base amount at each step during compute_all of taxes. -opw: 776986 --- addons/point_of_sale/static/src/js/models.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index a18bd707da6..43c375937ed 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -1407,7 +1407,7 @@ exports.Orderline = Backbone.Model.extend({ var recompute_base = function(base_amount, fixed_amount, percent_amount){ if(fixed_amount === 0.0 && percent_amount === 0.0) return base_amount; - return round_pr((base_amount - fixed_amount) / (1.0 + percent_amount / 100.0), currency_rounding); + return (base_amount - fixed_amount) / (1.0 + percent_amount / 100.0); } // 4) Iterate the taxes in the reversed sequence order to retrieve the initial base of the computation. @@ -1461,7 +1461,6 @@ exports.Orderline = Backbone.Model.extend({ taxes_vals.push(tax_vals); }); - return { taxes: taxes_vals, total_excluded: round_pr(total_excluded, currency_rounding_bak), From 4ebb5efac44fd4fe9066c32c533b9130e6e2e242 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 17 Oct 2017 10:46:14 +0200 Subject: [PATCH 07/18] [FIX] crm: match filter result with count At 9d2f48dc and abea8d35 the `not opp.date_closed` condtion was added when counting the number of overdue opportunites. The result filter was still considering the closed opportunities. opw-774421 --- addons/crm/views/crm_lead_views.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/crm/views/crm_lead_views.xml b/addons/crm/views/crm_lead_views.xml index a51c141bb52..0e4b844105f 100644 --- a/addons/crm/views/crm_lead_views.xml +++ b/addons/crm/views/crm_lead_views.xml @@ -340,7 +340,8 @@ ('activity_ids.date_deadline', '<=', (context_today()+datetime.timedelta(days=7)).strftime('%Y-%m-%d')) ]"/> From 727a642f5c72ee34e9d6f3c7a507591d05d7d839 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 17 Oct 2017 16:53:17 +0200 Subject: [PATCH 08/18] [FIX] crm: match count with result Followup of 4ebb5efac --- addons/crm/views/crm_lead_views.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/crm/views/crm_lead_views.xml b/addons/crm/views/crm_lead_views.xml index 0e4b844105f..fdc77ef4b80 100644 --- a/addons/crm/views/crm_lead_views.xml +++ b/addons/crm/views/crm_lead_views.xml @@ -584,10 +584,10 @@ ('activity_ids.date_deadline', '<=', (context_today()+datetime.timedelta(days=7)).strftime('%Y-%m-%d')) ]"/> From e0fbe7b5becf608f76f02123f3076cf27c54c20e Mon Sep 17 00:00:00 2001 From: rde Date: Mon, 16 Oct 2017 14:19:19 +0200 Subject: [PATCH 09/18] [FIX] website_sale: disable checkout btn if GTS unchecked at load opw-774286 *Before this commit: On checkout, you can enable a step to force user to have the General Terms of Sale checked to continue the checkout. Checking/Unchecking will correctly disabled/enabled the button. The checkbox is already checked at page load (on the template). BUT, if the template has been modified to set the checkbox as unchecked at load (eg the user removed 'checked="checked"' from the template), the button will still be enabled even if the checkbox is unchecked. *Now: No matter if it is checked or not on the template, the button will correctly be enabled/disabled regarding the checkbox state at load. --- addons/website_sale/static/src/js/website_sale_payment.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/website_sale/static/src/js/website_sale_payment.js b/addons/website_sale/static/src/js/website_sale_payment.js index 5b02f5b7c61..266c69a9db5 100644 --- a/addons/website_sale/static/src/js/website_sale_payment.js +++ b/addons/website_sale/static/src/js/website_sale_payment.js @@ -6,9 +6,10 @@ var ajax = require('web.ajax'); $(document).ready(function () { // If option is enable if ($("#checkbox_cgv").length) { - $("#checkbox_cgv").click(function() { + $("#checkbox_cgv").change(function() { $("div.oe_sale_acquirer_button").find('input, button').prop("disabled", !this.checked); }); + $('#checkbox_cgv').trigger('change'); } // When choosing an acquirer, display its Pay Now button From f971ed704c93738fb89576e44756c9e70ce7881d Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 18 Oct 2017 09:49:34 +0200 Subject: [PATCH 10/18] [FIX]sale: pricelist price base Fine tuning of this commit: c477f0764e2ab088233a68c53fc66eabf01ce2ec opw:775275 --- addons/sale/models/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py index 84ac2bfa5e8..3c1de5d79a6 100644 --- a/addons/sale/models/sale.py +++ b/addons/sale/models/sale.py @@ -857,7 +857,7 @@ class SaleOrderLine(models.Model): return price else: from_currency = self.order_id.company_id.currency_id - return from_currency.compute(product[pricelist_item.base], self.order_id.pricelist_id.currency_id) + return from_currency.compute(product[pricelist_item.base].lst_price, self.order_id.pricelist_id.currency_id) @api.multi @api.onchange('product_id') From 0012eb4c9704dd3430e024d0ce0e7bcb39c3c416 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Tue, 17 Oct 2017 16:59:38 +0200 Subject: [PATCH 11/18] [FIX] website_sale: included taxes considered as discount in the shop Steps to reproduce the bug: - In Sales settings, set "Tax display" as "Show line subtotals without taxes" - Create an article A with a customer tax set as price-inclusive. - associate on an other article B the pricelist P with a discount_policy set as "without_discount" - Ensure that the pricelist P is used in the shop. -Go to the shop Bug: The article A is considered as discounted but the price is full. The prices with included taxes were considered as discounted because lst_price - webstie_price were always greater than 0. When the "Show line subtotals without taxes" is checked for Tax display, the field website_price never includes the taxes. That's why the included taxes are substracted from the website_price. opw:776526 --- addons/website_sale/models/product.py | 6 ++++++ addons/website_sale/views/templates.xml | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/addons/website_sale/models/product.py b/addons/website_sale/models/product.py index 6c50e86c2b1..8d33629e927 100644 --- a/addons/website_sale/models/product.py +++ b/addons/website_sale/models/product.py @@ -3,6 +3,7 @@ from odoo import api, fields, models, tools, _ import odoo.addons.decimal_precision as dp from odoo.tools.translate import html_translate +from odoo.tools import float_is_zero class ProductStyle(models.Model): @@ -139,6 +140,7 @@ class ProductTemplate(models.Model): website_price = fields.Float('Website price', compute='_website_price', digits=dp.get_precision('Product Price')) website_public_price = fields.Float('Website public price', compute='_website_price', digits=dp.get_precision('Product Price')) + website_price_difference = fields.Boolean('Website price difference', compute='_website_price') def _website_price(self): # First filter out the ones that have no variant: @@ -148,6 +150,7 @@ class ProductTemplate(models.Model): for template, product in zip(self, self.mapped('product_variant_id')): template.website_price = product.website_price template.website_public_price = product.website_public_price + template.website_price_difference = product.website_price_difference def _default_website_sequence(self): self._cr.execute("SELECT MIN(website_sequence) FROM %s" % self._table) @@ -188,6 +191,7 @@ class Product(models.Model): website_price = fields.Float('Website price', compute='_website_price', digits=dp.get_precision('Product Price')) website_public_price = fields.Float('Website public price', compute='_website_price', digits=dp.get_precision('Product Price')) + website_price_difference = fields.Boolean('Website price difference', compute='_website_price') def _website_price(self): qty = self._context.get('quantity', 1.0) @@ -204,6 +208,8 @@ class Product(models.Model): for p, p2 in zip(self, self2): taxes = partner.property_account_position_id.map_tax(p.taxes_id.sudo().filtered(lambda x: x.company_id == company_id)) p.website_price = taxes.compute_all(p2.price, pricelist.currency_id, quantity=qty, product=p2, partner=partner)[ret] + price_without_pricelist = taxes.compute_all(p.list_price, pricelist.currency_id)[ret] + p.website_price_difference = False if float_is_zero(price_without_pricelist - p.website_price, precision_rounding=pricelist.currency_id.rounding) else True p.website_public_price = taxes.compute_all(p2.lst_price, quantity=qty, product=p2, partner=partner)[ret] @api.multi diff --git a/addons/website_sale/views/templates.xml b/addons/website_sale/views/templates.xml index 060206aaab5..381648690da 100644 --- a/addons/website_sale/views/templates.xml +++ b/addons/website_sale/views/templates.xml @@ -102,7 +102,7 @@
- + @@ -587,7 +587,7 @@

@@ -997,7 +997,7 @@
- + From 333a2360d8bc01b15c893398f4f101a5d24f512d Mon Sep 17 00:00:00 2001 From: Adrian Torres Date: Wed, 18 Oct 2017 10:18:47 +0200 Subject: [PATCH 12/18] [FIX] website_quote: don't unlink website_description This is a hotfix/hack for a conflict between website_quote and website_sale, on the field website_description. The conflict happens when both modules are installed. Fixes #20118 --- addons/website_quote/models/__init__.py | 1 + .../website_quote/models/ir_model_fields.py | 35 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 addons/website_quote/models/ir_model_fields.py diff --git a/addons/website_quote/models/__init__.py b/addons/website_quote/models/__init__.py index 011bafd821f..a83051f5a10 100644 --- a/addons/website_quote/models/__init__.py +++ b/addons/website_quote/models/__init__.py @@ -4,3 +4,4 @@ import sale_order import sale_quote import product_template +import ir_model_fields diff --git a/addons/website_quote/models/ir_model_fields.py b/addons/website_quote/models/ir_model_fields.py new file mode 100644 index 00000000000..55643edfe0d --- /dev/null +++ b/addons/website_quote/models/ir_model_fields.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import api, models + +# !! Attention, this is a hack of a hack, do not try this at home !! +# This is done because website_quote defines the website_description +# field which is also defined by website_sale, but these two modules +# are independent of each other, the part of the ORM that generates +# xmlids does not support this case therefore it only creates a single +# pair of xmlids for whichever module is installed first, therefore +# when uninstalling any of the two modules the website_descripion field +# will be deleted from the db and the other module won't be able to +# use this field, resulting in a crash and data-loss. +# See opw-776464 for more details. +# +# This is hotfixed by overriding the unlink method so as to not delete +# the website_description field if website_quote is uninstalled, it's +# an ugly hack but it works and big changes can't be done to the ORM +# in stable versions, Odoo v12+ will properly fix this + + +class IrModelFields(models.Model): + _inherit = "ir.model.fields" + + @api.multi + def unlink(self): + # Prevent the deletion of the field "website_description" + self = self.filtered( + lambda rec: not ( + rec.model in ('product.product', 'product.template') and + rec.name == 'website_description' + ) + ) + return super(IrModelFields, self).unlink() From 130dc1b64f88e99f16b618390b55748b02e439f4 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 18 Oct 2017 11:26:10 +0200 Subject: [PATCH 13/18] [FIX]sale: pricelist price base Revert of c477f0764e2ab088233a68c53fc66eabf01ce2ec In some case product[pricelist_item.base] can be a product.product opw:775275 --- addons/sale/models/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py index 3c1de5d79a6..1c644a9cdaf 100644 --- a/addons/sale/models/sale.py +++ b/addons/sale/models/sale.py @@ -857,7 +857,7 @@ class SaleOrderLine(models.Model): return price else: from_currency = self.order_id.company_id.currency_id - return from_currency.compute(product[pricelist_item.base].lst_price, self.order_id.pricelist_id.currency_id) + return from_currency.compute(product.lst_price, self.order_id.pricelist_id.currency_id) @api.multi @api.onchange('product_id') From 1108c150d9a61bc437a07f03a809c8907714edf4 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 18 Oct 2017 12:16:27 +0200 Subject: [PATCH 14/18] [FIX]sale: pricelist price base Fine tuning of c477f0764e2ab088233a68c53fc66eabf01ce2ec When setting a pricelist to show the public price discount, it ignored the pricelist item's base field (if not 'Other Pricelist') and set it by default on the lst_price instead. This did not work when you based your discount on the standard_price (= cost price) with public price discount. Now it does. opw:775275 --- addons/sale/models/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py index 1c644a9cdaf..2c24bee1549 100644 --- a/addons/sale/models/sale.py +++ b/addons/sale/models/sale.py @@ -857,7 +857,7 @@ class SaleOrderLine(models.Model): return price else: from_currency = self.order_id.company_id.currency_id - return from_currency.compute(product.lst_price, self.order_id.pricelist_id.currency_id) + return from_currency.compute(pricelist_item and product[pricelist_item.base] or product.lst_price, self.order_id.pricelist_id.currency_id) @api.multi @api.onchange('product_id') From c7f5ad87a4ee2b6fae845aba213ae6ebd41465e8 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Wed, 18 Oct 2017 11:18:45 +0200 Subject: [PATCH 15/18] [FIX] web_editor: odoo-made tables should not be layout: fixed --- addons/web_editor/static/src/less/web_editor.common.less | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/less/web_editor.common.less b/addons/web_editor/static/src/less/web_editor.common.less index 8b1b31e2334..a3b078808ee 100644 --- a/addons/web_editor/static/src/less/web_editor.common.less +++ b/addons/web_editor/static/src/less/web_editor.common.less @@ -24,7 +24,9 @@ html, body { /* ----- GENERIC LAYOUTING HELPERS ---- */ /* table */ #wrapwrap, .o_editable { - table.table { + // Only style editor-made tables (shop/portal/... tables are not supposed to + // use table-bordered...) + table.table.table-bordered { table-layout: fixed; td { min-width: 20px; From 2d46dbcbfd122eaf1686623cf8cf319178e31109 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Wed, 18 Oct 2017 14:53:10 +0200 Subject: [PATCH 16/18] [FIX] ir_http: use meaningful ETag for images (#20283) After setting the image on a product variant, the controller for `/web/image` incorrectly returns the code 304 - Not Modified. This bug occurs because 1. the response ETag is a hash of the **last modified date** of the record; 2. the record is actually **not** updated in that case, because - the image field is a non-stored computed field, and - its inverse method only modifies the variant's template. Fix the issue by making the response ETag a hash of the **content**, which is read by the controller anyway. OPW 769302 --- odoo/addons/base/ir/ir_http.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/addons/base/ir/ir_http.py b/odoo/addons/base/ir/ir_http.py index 1d942e75a86..df15e45df22 100644 --- a/odoo/addons/base/ir/ir_http.py +++ b/odoo/addons/base/ir/ir_http.py @@ -324,7 +324,7 @@ class IrHttp(models.AbstractModel): # cache etag = hasattr(request, 'httprequest') and request.httprequest.headers.get('If-None-Match') - retag = '"%s"' % hashlib.md5(last_update).hexdigest() + retag = '"%s"' % hashlib.md5(content).hexdigest() status = status or (304 if etag == retag else 200) headers.append(('ETag', retag)) headers.append(('Cache-Control', 'max-age=%s' % (STATIC_CACHE if unique else 0))) From de70646bc5afde6c91784725dedd5141e994ee82 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Wed, 18 Oct 2017 15:17:40 +0200 Subject: [PATCH 17/18] [FIX] website_sale: correct js syntax Oversight of forward-port a01e76efa71d4db2fa9de0095d13bdfc359f91f0 --- addons/website_sale/static/src/js/website_sale_payment.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_sale/static/src/js/website_sale_payment.js b/addons/website_sale/static/src/js/website_sale_payment.js index 8923483fb61..39cbea8d165 100644 --- a/addons/website_sale/static/src/js/website_sale_payment.js +++ b/addons/website_sale/static/src/js/website_sale_payment.js @@ -8,7 +8,7 @@ $(document).ready(function () { if ($("#checkbox_cgv").length) { $("#checkbox_cgv").change(function() { $("div.oe_sale_acquirer_button").find('input, button').prop("disabled", !this.checked); - }; + }); $('#checkbox_cgv').trigger('change'); } From 388bf45853d154e23f0c3653094bc1aa12d06634 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 18 Oct 2017 10:49:28 +0200 Subject: [PATCH 18/18] [FIX] mail: indentation issue when forward-porting Commit aab6bdd54a11cb8bdb19746a9861776d3be622a6 was incorrectly forward-ported to 10.0 at abb726d4dfaae87438471283aedd177d5432f10a . Indeed share users could land to a wrong backend or frontend page depending on the target app due to an indentation issue. --- addons/mail/controllers/main.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/mail/controllers/main.py b/addons/mail/controllers/main.py index 4fe78246ec5..7c4f42d9f5a 100644 --- a/addons/mail/controllers/main.py +++ b/addons/mail/controllers/main.py @@ -87,9 +87,8 @@ class MailController(http.Controller): record_sudo.sudo(uid).check_access_rule('read') except AccessError: return cls._redirect_to_messaging() - - if record_action['type'] == 'ir.actions.act_url': - return werkzeug.utils.redirect(record_action['url']) + if record_action['type'] == 'ir.actions.act_url': + return werkzeug.utils.redirect(record_action['url']) url_params = { 'view_type': record_action['view_type'],