From 58c64558a9a3188edccd1c60042de9f6e639b4a1 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Fri, 12 Apr 2019 08:20:01 +0000 Subject: [FIX] web: checkbox readonly is RO in list editable Since f4fbaf1efa the structure of checkboxes has been improved, now we have something like: ``` ``` With the first input invisible (whilst before it was visible and the clickable element). This cause an issue in an editable list view: - we have a boolean readonly field in a cell - we are on focused on a line (not in the boolean field cell) - we click on the boolean field => the check mark is toggled This is because when we switch cell, we try to activate the widget of the other cell. Before f4fbaf1efa this issue did not happen since the browser do not generate a click event when clicking a disabled checkbox. With this changeset, a disabled FieldBoolean is not focusable as is the case for other fields, so we can't "activate" it. Without the fix, the added test fails with: [clicking disabled checkbox did not work] opw-1958433 closes #32652 Signed-off-by: Aaron Bohy (aab) --- addons/web/static/src/js/fields/basic_fields.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index a4284841130..f924f24d2fa 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -805,7 +805,7 @@ var FieldBoolean = AbstractField.extend({ * @returns {jQuery} the focusable checkbox input */ getFocusableElement: function () { - return this.$input || $(); + return this.mode === 'readonly' ? $() : this.$input; }, /** * A boolean field is always set since false is a valid value. -- cgit v1.2.3 From 02a321cffb2da60a86b960e75c445e37094567b4 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Mon, 1 Apr 2019 14:14:44 +0000 Subject: [FIX] web: use specific font for Arabic, Hebrew and Cyrillic alphabet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The basic font-family offered on Odoo do not support a large set of characters and rely on the system fonts for non-latin languages On a system without specific fonts installed, the characters were replaced by � For Hebrew, the system sans-serif font (at least on Windows pc) was too small. Rely on the unicode-range range CSS descriptor to load a font only for a specific range of unicode code. https://developer.mozilla.org/en-US/docs/Web/CSS/%40font-face/unicode-range This way, the fonts are ignored for English text (and you don't have to load the fonts of every possible language). Add Noto fonts that covers many charsets. There is an heavy version for many charset and lighter ones for Arabic and Hebrew More ranges can be added later Serve the fonts on our CDN to avoid shipping several MB of fonts for everyone but lazyload it when needed. Fixes odoo/odoo#32228 Fixes odoo/odoo#21781 --- .../web/static/src/scss/bootstrap_overridden.scss | 2 +- addons/web/static/src/scss/fonts.scss | 30 ++++++++++++++++++++++ addons/web/static/src/scss/layout_clean.scss | 2 +- 3 files changed, 32 insertions(+), 2 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/scss/bootstrap_overridden.scss b/addons/web/static/src/scss/bootstrap_overridden.scss index e8406c948e9..edd0065d287 100644 --- a/addons/web/static/src/scss/bootstrap_overridden.scss +++ b/addons/web/static/src/scss/bootstrap_overridden.scss @@ -61,7 +61,7 @@ $component-active-bg: $gray-200; // // Font, line-height, and color for body text, headings, and more. -$font-family-sans-serif: "Lucida Grande", Helvetica, Verdana, Arial, sans-serif; +$font-family-sans-serif: "Noto", "Lucida Grande", Helvetica, Verdana, Arial, sans-serif; $font-size-base: $o-font-size-base; $line-height-base: $o-line-height-base; diff --git a/addons/web/static/src/scss/fonts.scss b/addons/web/static/src/scss/fonts.scss index bfabf4fe6fc..0a8793c9a18 100644 --- a/addons/web/static/src/scss/fonts.scss +++ b/addons/web/static/src/scss/fonts.scss @@ -4,6 +4,36 @@ $lato-font-path: '../fonts/lato'; @mixin lato-font($type, $weight, $style) { + // Cyrillic: U+0400-04FF, U+0500-052F + @font-face { + font-family: 'Noto'; + src: url('https://fonts.odoocdn.com/fonts/noto/NotoSans-#{$type}.woff2') format('woff2'), + url('https://fonts.odoocdn.com/fonts/noto/NotoSans-#{$type}.woff') format('woff'), + url('https://fonts.odoocdn.com/fonts/noto/NotoSans-#{$type}.ttf') format('truetype'); + font-weight: $weight; + font-style: $style; + unicode-range: U+0400-04FF, U+0500-052F; + } + // Hebrew: U+0590-05FF, U+FB1D-FB4F + @font-face { + font-family: 'Noto'; + src: url('https://fonts.odoocdn.com/fonts/noto/NotoSansHebrew-#{$type}.woff2') format('woff2'), + url('https://fonts.odoocdn.com/fonts/noto/NotoSansHebrew-#{$type}.woff') format('woff'), + url('https://fonts.odoocdn.com/fonts/noto/NotoSansHebrew-#{$type}.ttf') format('truetype'); + font-weight: $weight; + font-style: $style; + unicode-range: U+0590-05FF, U+FB1D-FB4F; + } + // Arabic: U+0600-06FF, U+0750-077F + @font-face { + font-family: 'Noto'; + src: url('https://fonts.odoocdn.com/fonts/noto/NotoSansArabic-#{$type}.woff2') format('woff2'), + url('https://fonts.odoocdn.com/fonts/noto/NotoSansArabic-#{$type}.woff') format('woff'), + url('https://fonts.odoocdn.com/fonts/noto/NotoSansArabic-#{$type}.ttf') format('truetype'); + font-weight: $weight; + font-style: $style; + unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF; + } @font-face { font-family: 'Lato'; src: url('#{$lato-font-path}/Lato-#{$type}-webfont.eot'); diff --git a/addons/web/static/src/scss/layout_clean.scss b/addons/web/static/src/scss/layout_clean.scss index 910abc763a4..0a8f4b065af 100644 --- a/addons/web/static/src/scss/layout_clean.scss +++ b/addons/web/static/src/scss/layout_clean.scss @@ -1,5 +1,5 @@ .o_clean_footer, .o_clean_header, .o_report_layout_clean { - font-family: 'Lato'; + font-family: 'Lato', 'Noto'; color: #000; } .o_clean_header { -- cgit v1.2.3 From 7bf25cc333b0a3afc7e0a67f76f019407dba7e12 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Mon, 15 Apr 2019 12:41:26 +0000 Subject: [FIX] web: search view handles JSON parsable domains Before this commit, a domain that had been written in order to be JSON parsable, would trigger a JS crash when activated in the UI It happens when adding custom filters through the edition of the search view with studio This was because, Odoo developers write, in the XML of a search view domains python style: `[('field', '=', 'value')]` When parsing the view in JS, this doesn't get altered by `xml_to_json` Then, the search view code evaluates it python style This commit considers that behavior fortunate, but not really clear or conceptually correct But, when customizing a search view with studio, the domain is written by the code, in JS JSON parsable format `[["field", "=", "value"]]` This should be supported too, as so many customizations may have been done before hand After this commit, both expressions are supported by the filters menu OPW 1957297, 1960732, 1965649 (at least) closes odoo/odoo#32690 Signed-off-by: Lucas Perais (lpe) --- addons/web/static/src/js/views/search/search_inputs.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/views/search/search_inputs.js b/addons/web/static/src/js/views/search/search_inputs.js index d92616cfe3e..efdacca9dc8 100644 --- a/addons/web/static/src/js/views/search/search_inputs.js +++ b/addons/web/static/src/js/views/search/search_inputs.js @@ -676,6 +676,9 @@ var FilterGroup = Input.extend(/** @lends instance.web.search.FilterGroup# */{ .without('[]') .reject(_.isEmpty) .map(function (domain) { + if (typeof domain !== 'string') { + domain = JSON.stringify(domain); + } domain = domain.replace(/%%/g, '%'); return domain; }) -- cgit v1.2.3