From ea6e7379a35e91f9ad064e5ad1e87c5177ea067b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Fri, 9 Feb 2018 15:47:43 +0100 Subject: [DOC] doc: update/add documentation on js framework The state of the JS documentation was quite sad, not updated in a long time. With this commit, we rework a lot of the JS doc. Most notably, we add a section 'Javascript Cheatsheet' (help on some common customization tasks) and rewrite the 'Javascript Reference' totally. Note that the JS reference page also contains a reference on all field widgets. This work is just the beginning, it is probably not complete, but at least we will have a foundation. --- addons/web/static/src/js/fields/basic_fields.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src/js/fields/basic_fields.js') diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index 8a42f91161c..eb0a4a2cdaf 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -1757,7 +1757,7 @@ var StatInfo = AbstractField.extend({ var FieldPercentPie = AbstractField.extend({ template: 'FieldPercentPie', - supportedFieldTypes: ['integer'], + supportedFieldTypes: ['integer', 'float'], /** * Register some useful references for later use throughout the widget. -- cgit v1.2.3 From b8b0f947bf7f7abf930a1797fa55c7f7dd33faa2 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Fri, 13 Apr 2018 14:30:46 +0200 Subject: [FIX] web: remove ­ when saving phone number When Odoo display a phone number number, on phone or if VOIP is installed a invisible `­` character was added from 9.0 up to saas-11.2 so an applications such as skype would not be concerned with the number. But if someone copy-pasted from this to somewhere else in Odoo, we would get incorrect number with this invisible caracter. So this change make a special case for the "FieldPhone" so the character is removed from data saved. opw-1834858 closes #24223 --- addons/web/static/src/js/fields/basic_fields.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'addons/web/static/src/js/fields/basic_fields.js') diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index eb0a4a2cdaf..aff339cb4a2 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -1013,6 +1013,21 @@ var FieldPhone = FieldEmail.extend({ this.$el.removeClass('o_text_overflow'); }, + /** + * Remove possibly present ­ characters when saving number + * + * @override + * @private + */ + _setValue: function (value, options) { + // NOT NEEDED AS OF SAAS-11.3 + if (value) { + // remove possibly pasted ­ characters + value = value.replace(/\u00AD/g, ''); + } + return this._super(value, options); + }, + /** * Phone fields are clickable in readonly on small screens ~= on phones. * This can be overriden by call-capable modules to display a clickable -- cgit v1.2.3 From 65d8a082df02d72a37c5e9d06539a69adab04c4a Mon Sep 17 00:00:00 2001 From: Vincent Schippefilt Date: Thu, 12 Apr 2018 16:38:14 +0200 Subject: [FIX] web: fix keyboard related crash in client actions --- addons/web/static/src/js/fields/basic_fields.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src/js/fields/basic_fields.js') diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index ae0da5427ad..0f426dedd3b 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -319,7 +319,9 @@ var InputField = DebouncedField.extend({ || (ev.data.direction === "right" && (selecting || input.selectionStart !== input.value.length))) { ev.stopPropagation(); } - if (ev.data.direction ==='next' && this.attrs.modifiersValue.required) { + if (ev.data.direction ==='next' && + this.attrs.modifiersValue && + this.attrs.modifiersValue.required) { if (!this.$input.val()){ this.setInvalidClass(); ev.stopPropagation(); -- cgit v1.2.3 From 5dca782100ae156a8a5c778092d1da9c0d5d7edc Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Mon, 16 Apr 2018 20:26:21 +0200 Subject: Revert "[FIX] web: remove ­ when saving phone number" This reverts commit b8b0f947bf7f7abf930a1797fa55c7f7dd33faa2. --- addons/web/static/src/js/fields/basic_fields.js | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'addons/web/static/src/js/fields/basic_fields.js') diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index c703694a9d4..0f426dedd3b 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -998,21 +998,6 @@ var FieldPhone = FieldEmail.extend({ // important right now. this.$el.removeClass('o_text_overflow'); }, - * Remove possibly present ­ characters when saving number - * - * @override - * @private - */ - _setValue: function (value, options) { - // NOT NEEDED AS OF SAAS-11.3 - if (value) { - // remove possibly pasted ­ characters - value = value.replace(/\u00AD/g, ''); - } - return this._super(value, options); - }, - - /** }); var UrlWidget = InputField.extend({ -- cgit v1.2.3