From 47c0cfc6e790df0f655ac3aa096fb807a6306a46 Mon Sep 17 00:00:00 2001 From: Joren Van Onder Date: Mon, 23 Oct 2017 14:51:17 -0700 Subject: [PATCH 1/3] [FIX] point_of_sale: don't redeclare sign var is function-scope (not block-scope) so this happens to work, but it's confusing. --- addons/point_of_sale/static/src/js/models.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 43c375937ed..caaa1d6acbc 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -1416,7 +1416,7 @@ exports.Orderline = Backbone.Model.extend({ var sign = 1; if(base < 0){ base = -base; - var sign = -1; + sign = -1; } var incl_fixed_amount = 0.0; From 33d20a224164cd83f09018addcf02496f22bced2 Mon Sep 17 00:00:00 2001 From: Joren Van Onder Date: Mon, 23 Oct 2017 14:51:28 -0700 Subject: [PATCH 2/3] [FIX] point_of_sale: allow negative prices again 5afb5ecd04cf49be6bedb655b187b19a65e1e02d rewrote the tax computation in both account and point_of_sale to fix complex tax computations but it no longer allowed negative prices in the point of sale. opw-778013 --- addons/point_of_sale/static/src/js/models.js | 4 ++-- 1 file changed, 2 insertions(+), 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 caaa1d6acbc..edc1114389a 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -1463,8 +1463,8 @@ exports.Orderline = Backbone.Model.extend({ }); return { taxes: taxes_vals, - total_excluded: round_pr(total_excluded, currency_rounding_bak), - total_included: round_pr(total_included, currency_rounding_bak) + total_excluded: sign * round_pr(total_excluded, currency_rounding_bak), + total_included: sign * round_pr(total_included, currency_rounding_bak) }; }, get_all_prices: function(){ From 7bd8f9a5b2cde69cb68c71998973a1fe38c97e02 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Mon, 23 Oct 2017 17:12:57 +0200 Subject: [PATCH 3/3] [FIX] web_editor: replacing selected text in a hierarchy on Firefox When following these steps on Firefox: - Select all text in a bold link (triple click) - Type some text The typed text did not replace the selected text but was instead put at the front of it. --- addons/web_editor/static/src/js/summernote.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/addons/web_editor/static/src/js/summernote.js b/addons/web_editor/static/src/js/summernote.js index 51dd3df97ed..bdd365ff93f 100644 --- a/addons/web_editor/static/src/js/summernote.js +++ b/addons/web_editor/static/src/js/summernote.js @@ -550,6 +550,13 @@ dom.removeBetween = function (sc, so, ec, eo, towrite) { so = 0; eo = 1; } + + var parentNode = sc && sc.parentNode; + if (parentNode && sc.tagName === 'BR') { + sc = parentNode; + ec = parentNode; + } + return { sc: sc, so: so, @@ -1164,9 +1171,9 @@ $.summernote.pluginEvents.visible = function (event, editor, layoutInfo) { if (!r) return; if (!r.isCollapsed()) { - if (dom.isCell(dom.node(r.sc)) || dom.isCell(dom.node(r.ec))) { + if ((dom.isCell(dom.node(r.sc)) || dom.isCell(dom.node(r.ec))) && dom.node(r.sc) !== dom.node(r.ec)) { remove_table_content(r); - r = range.create(r.ec, 0).select(); + r = range.create(r.ec, 0); } else { r = r.deleteContents(true); }