From 1d12623a6eeb679dd0867028692bfeaad959e1a1 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Mon, 8 Jun 2015 01:35:43 +0200 Subject: [PATCH 01/11] [ADD] new module web_custom_search_quantity; --- web_custom_search_quantity/__init__.py | 21 +++++ web_custom_search_quantity/__openerp__.py | 67 +++++++++++++++ web_custom_search_quantity/i18n/fr.po | 23 ++++++ .../i18n/web_custom_search_quantity.pot | 23 ++++++ .../src/css/web_custom_search_quantity.css | 22 +++++ .../static/src/img/icon.png | Bin 0 -> 3333 bytes .../src/js/web_custom_search_quantity.js | 76 ++++++++++++++++++ 7 files changed, 232 insertions(+) create mode 100644 web_custom_search_quantity/__init__.py create mode 100644 web_custom_search_quantity/__openerp__.py create mode 100644 web_custom_search_quantity/i18n/fr.po create mode 100644 web_custom_search_quantity/i18n/web_custom_search_quantity.pot create mode 100644 web_custom_search_quantity/static/src/css/web_custom_search_quantity.css create mode 100644 web_custom_search_quantity/static/src/img/icon.png create mode 100644 web_custom_search_quantity/static/src/js/web_custom_search_quantity.js diff --git a/web_custom_search_quantity/__init__.py b/web_custom_search_quantity/__init__.py new file mode 100644 index 00000000..aa7377eb --- /dev/null +++ b/web_custom_search_quantity/__init__.py @@ -0,0 +1,21 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Web - Custom Search Quantity module for Odoo +# Copyright (C) 2015-Today Akretion (http://www.akretion.com) +# @author Sylvain LE GAL (https://twitter.com/legalsylvain) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## diff --git a/web_custom_search_quantity/__openerp__.py b/web_custom_search_quantity/__openerp__.py new file mode 100644 index 00000000..f8e308b4 --- /dev/null +++ b/web_custom_search_quantity/__openerp__.py @@ -0,0 +1,67 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Web - Custom Search Quantity module for Odoo +# Copyright (C) 2015-Today Akretion (http://www.akretion.com) +# @author Sylvain LE GAL (https://twitter.com/legalsylvain) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +{ + 'name': 'Web - Custom Search Quantity', + 'version': '1.0', + 'category': 'web', + 'description': """ +Allow users to set manually a quantity of items to display in a tree view +========================================================================= + +Functionality: +-------------- + * By default, in Odoo, user can display 80 / 200 / 500 / 2000 elements in + a tree view; + With that module, user can select a custom number of items to display; + +Technical information: +---------------------- + * replace a select element by an input with datalist option. That allows + to set a custom value, or to select an option. (same options as before: + 80 / 200 / 500 / 2000 / unlimited); + + * WARNING: 'Datalist' is a HTML5 tag; If your browser is not HTML5 + compliant, the options will not be displayed (but it is possible for + user to select manually a value); + See browser Support: http://www.w3schools.com/tags/tag_datalist.asp + +Copyright, Author and Licence: +------------------------------ + * Copyright: + * 2015-Today, Akretion; + * Author: + * Sylvain LE GAL (https://twitter.com/legalsylvain); + * Licence: AGPL-3 (http://www.gnu.org/licenses/)""", + 'author': "GRAP,Odoo Community Association (OCA)", + 'website': 'http://www.grap.coop', + 'license': 'AGPL-3', + 'depends': [ + 'web', + ], + 'js': [ + 'static/src/js/web_custom_search_quantity.js', + ], + 'css': [ + "static/src/css/web_custom_search_quantity.css", + ], +} diff --git a/web_custom_search_quantity/i18n/fr.po b/web_custom_search_quantity/i18n/fr.po new file mode 100644 index 00000000..181fbee1 --- /dev/null +++ b/web_custom_search_quantity/i18n/fr.po @@ -0,0 +1,23 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-06-07 23:26+0000\n" +"PO-Revision-Date: 2015-06-07 23:26+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: web_custom_search_quantity +#. openerp-web +#: code:addons/web_custom_search_quantity/static/src/js/web_custom_search_quantity.js:56 +#, python-format +msgid "0 (Unlimited)" +msgstr "0 (Illimité)" + diff --git a/web_custom_search_quantity/i18n/web_custom_search_quantity.pot b/web_custom_search_quantity/i18n/web_custom_search_quantity.pot new file mode 100644 index 00000000..82ba3e07 --- /dev/null +++ b/web_custom_search_quantity/i18n/web_custom_search_quantity.pot @@ -0,0 +1,23 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-06-07 23:25+0000\n" +"PO-Revision-Date: 2015-06-07 23:25+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: web_custom_search_quantity +#. openerp-web +#: code:addons/web_custom_search_quantity/static/src/js/web_custom_search_quantity.js:56 +#, python-format +msgid "0 (Unlimited)" +msgstr "" + diff --git a/web_custom_search_quantity/static/src/css/web_custom_search_quantity.css b/web_custom_search_quantity/static/src/css/web_custom_search_quantity.css new file mode 100644 index 00000000..b42d7b45 --- /dev/null +++ b/web_custom_search_quantity/static/src/css/web_custom_search_quantity.css @@ -0,0 +1,22 @@ +/****************************************************************************** + Web - Custom Search Quantity module for Odoo + Copyright (C) 2015-Today Akretion (http://www.akretion.com) + @author Sylvain LE GAL (https://twitter.com/legalsylvain) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +******************************************************************************/ + +.custom_search_quantity { + width:50px; +} \ No newline at end of file diff --git a/web_custom_search_quantity/static/src/img/icon.png b/web_custom_search_quantity/static/src/img/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..0d11906dfcb99614f651e6360ab5e8120784b29d GIT binary patch literal 3333 zcmchacQhN^|HorIW{XNSYE-DvqV{a8+FD7~RwGvE5@OZXqG}T(DnT{0Mm_N;6?u%J zRIRG28WEe6(1=l+pZ?D8zu({A?>*;p-{;=@IiK^n=e*8&-E^{?6USg1 zf1lvT9)SqJ4R3!>1lYpQ!xv$V@bC^t^&oTrfHQFx#y4!k3fBsw16&X--TKtkV%-Cb znj-WTRyy~a757!eAJ%L)yC$B>cELy~M2Y;kl-^yHl!%tnDY>+aq|n~}qxc~?`zzqq zC&V~wCWzpbAkzDW@63KIIcgL?n`~+5zvH8IR7U0i@|}f76HXeJKDb$+J-oW7OAU{S zET-=jO^1J}dCMuz%5{IpcY>*_AI}Qbz6r=K{V&Trt5)c$Alf`(m|pzie(X&cB1F{A z&Q483BjX`aK9xXFh-(M4u&_8{x`Gd@ttI)}=NXpa9{|`lvw@@v0^v<yf|ZyEDbgU%y7A4ZM>-Emc%hWNT|{%?SjPg)S5j5QHLPaCEZE~M z{Q!TtH)L-39u_m)eNXMCN1j%1UuQ4tJ*?j!ft048m_yzk8B3 zPVX3;L4x^QLlTAi-u>ez?CuEgl7Sn&g{P8YR850egf2)lJ|7bkllU>Ek1qlq;R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a&{=&aN# zkuhF?z#V0@jjBZ}!;h@cC|G8j`A?2$_d9ttzuj6DAk(K*W+fel7hx6U*%o%3mJiPr zCPk@2fzV+=5s^;nCiH;&&9a`EA;@R23}5k``sVl1Q7=I@B}u?XrKB!T!9-@ag)IzwTm8z|xASBT@3Ky!$Sik>=bz}{j$ z^${rDl=GRPQ)X}-Cv-SKOQey4jM9VKGyS7VX;XtvOiY+d@*DjA=C{9jkE>uS5XKB0 z?xgQf{ivZ$L8i&$8PW-Sk#`>t){CW_bE)(3>-p3x`840H74ID{8yK|S)|#E62{|c` z_w2P|&JvLV^xR?2DxB*LHHou{rSy2+rY{*#0T#XjAQ#fpYtG1$an1U5&+T_~qWo}eFrFmmr!h4ertsN8`_F~w!@}=D_@eXD% zj7k@Cr>V*~Z44=HY%4x;KPKO1v^9XV5CWbKxmdi!lclEIK_n#+sbwutMR!i2{)}n3 z6rF>7s7;lbUK)30sv13#c}xjACmrXrgK9mT_Z=T0VaT9`T1AaFRA<>hYwyXCfHD~| z@Wof<(;eFW;z5O3Kea8%C8<(!Ldwr44lph~5`SlY^z%(xtOdd4Uu!vhnf-(V@6Mg9 zd(T8^P(r2bgvNZEE_M!1rp&hCNmVas&#WFNgtzNx-le;pyltN&3M?EMqxuq-;8ic1+sk7y{nRxHonCwqR69j7#`x9UXeG zT5it7(c!P#&ik0viSe4gUYV!v#9jys+q2wC0pl- zJXxzti!#TSC)t@new2&X$%AFTX$n;PS=%^Tm1bX;QP-adq_&ndcH{t+ci z!<`9Os+GG5Lop}4T%g~0DiE7378P0cDv>wZUykTHgI~UU@gTZc8 zaoVcKOO;nYV741@U%vYGe~%+Zli}Jb%J7C2Fwp+KuM_8+{?b$Xi7LE%c zF;P32yUtPd;;z7ZXRa+ACYT*>vFW06HVKVrh+Z9fF({ER9rXSr$7Us4$qwk~Q-L)w zvG@b7CBNeeyxcmM9eafeN7-9KRxbR6ZmyVFEKI7`n&(4<^bx AeE. +******************************************************************************/ + +openerp.web_custom_search_quantity = function (instance) { + module = instance.web; + _t = module._t; + + /*************************************************************************** + Extend the widget 'instance.web.ListView' to replace the select tag by an + input with datalist option. + ***************************************************************************/ + module.ListView.include({ + + /** + * Overload 'load_list' function: + */ + load_list: function(data) { + var self = this; + this._super.apply(this, arguments); + + if (this.$pager){ + // unbind previous function that added a select tag + this.$pager.find('.oe_list_pager_state').unbind("click"); + + // bind a new function on click, that add a input type select + this.$pager.find('.oe_list_pager_state').click(function (e) { + e.stopPropagation(); + var $this = $(this); + var $select = $('') + .appendTo($this.empty()) + .click(function (e) {e.stopPropagation();}) + .append( + '' + + '') + .change(function () { + var val = parseInt($select.val(), 10); + if (!isNaN(val)){ + if (val == 0){ + self._limit = null; + } + else{ + self._limit = val; + } + self.page = 0; + self.reload_content(); + } + }).blur(function() { + $(this).trigger('change'); + }) + .val(self._limit || '0'); + }); + } + }, + }); +}; From 5d36d5459afd075cc3e37603368e4d883f146e4e Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Mon, 8 Jun 2015 02:00:03 +0200 Subject: [PATCH 02/11] [IMP] UX. add focus and validation on enter; --- .../static/src/js/web_custom_search_quantity.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/web_custom_search_quantity/static/src/js/web_custom_search_quantity.js b/web_custom_search_quantity/static/src/js/web_custom_search_quantity.js index 9e437544..7883cf42 100644 --- a/web_custom_search_quantity/static/src/js/web_custom_search_quantity.js +++ b/web_custom_search_quantity/static/src/js/web_custom_search_quantity.js @@ -68,6 +68,12 @@ openerp.web_custom_search_quantity = function (instance) { }).blur(function() { $(this).trigger('change'); }) + .keypress(function(e) { + if(e.which == 13) { + $(this).trigger('change'); + } + }) + .focus() .val(self._limit || '0'); }); } From b490475513bcdf5e629b0f59e9b8da38f34cffb6 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Fri, 19 Jun 2015 10:16:44 +0200 Subject: [PATCH 03/11] [REF] remove useless licence in an empty file --- web_custom_search_quantity/__init__.py | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/web_custom_search_quantity/__init__.py b/web_custom_search_quantity/__init__.py index aa7377eb..dae354a6 100644 --- a/web_custom_search_quantity/__init__.py +++ b/web_custom_search_quantity/__init__.py @@ -1,21 +1 @@ # -*- encoding: utf-8 -*- -############################################################################## -# -# Web - Custom Search Quantity module for Odoo -# Copyright (C) 2015-Today Akretion (http://www.akretion.com) -# @author Sylvain LE GAL (https://twitter.com/legalsylvain) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## From 497a7398182cc2d3fd5a3fed8741fbbec5ffeac1 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Wed, 24 Jun 2015 00:03:18 +0200 Subject: [PATCH 04/11] [REF] Fix Author name --- web_custom_search_quantity/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_custom_search_quantity/__openerp__.py b/web_custom_search_quantity/__openerp__.py index f8e308b4..b66b2f79 100644 --- a/web_custom_search_quantity/__openerp__.py +++ b/web_custom_search_quantity/__openerp__.py @@ -52,7 +52,7 @@ Copyright, Author and Licence: * Author: * Sylvain LE GAL (https://twitter.com/legalsylvain); * Licence: AGPL-3 (http://www.gnu.org/licenses/)""", - 'author': "GRAP,Odoo Community Association (OCA)", + 'author': "Akretion,Odoo Community Association (OCA)", 'website': 'http://www.grap.coop', 'license': 'AGPL-3', 'depends': [ From f97885a0572ba06b885a0020e436dc110a0a010d Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Mon, 8 Jun 2015 01:35:43 +0200 Subject: [PATCH 05/11] [ADD] new module web_custom_search_quantity; --- web_custom_search_quantity/__init__.py | 21 +++++ web_custom_search_quantity/__openerp__.py | 67 +++++++++++++++ web_custom_search_quantity/i18n/fr.po | 23 ++++++ .../i18n/web_custom_search_quantity.pot | 23 ++++++ .../src/css/web_custom_search_quantity.css | 22 +++++ .../static/src/img/icon.png | Bin 0 -> 3333 bytes .../src/js/web_custom_search_quantity.js | 76 ++++++++++++++++++ 7 files changed, 232 insertions(+) create mode 100644 web_custom_search_quantity/__init__.py create mode 100644 web_custom_search_quantity/__openerp__.py create mode 100644 web_custom_search_quantity/i18n/fr.po create mode 100644 web_custom_search_quantity/i18n/web_custom_search_quantity.pot create mode 100644 web_custom_search_quantity/static/src/css/web_custom_search_quantity.css create mode 100644 web_custom_search_quantity/static/src/img/icon.png create mode 100644 web_custom_search_quantity/static/src/js/web_custom_search_quantity.js diff --git a/web_custom_search_quantity/__init__.py b/web_custom_search_quantity/__init__.py new file mode 100644 index 00000000..aa7377eb --- /dev/null +++ b/web_custom_search_quantity/__init__.py @@ -0,0 +1,21 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Web - Custom Search Quantity module for Odoo +# Copyright (C) 2015-Today Akretion (http://www.akretion.com) +# @author Sylvain LE GAL (https://twitter.com/legalsylvain) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## diff --git a/web_custom_search_quantity/__openerp__.py b/web_custom_search_quantity/__openerp__.py new file mode 100644 index 00000000..f8e308b4 --- /dev/null +++ b/web_custom_search_quantity/__openerp__.py @@ -0,0 +1,67 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Web - Custom Search Quantity module for Odoo +# Copyright (C) 2015-Today Akretion (http://www.akretion.com) +# @author Sylvain LE GAL (https://twitter.com/legalsylvain) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +{ + 'name': 'Web - Custom Search Quantity', + 'version': '1.0', + 'category': 'web', + 'description': """ +Allow users to set manually a quantity of items to display in a tree view +========================================================================= + +Functionality: +-------------- + * By default, in Odoo, user can display 80 / 200 / 500 / 2000 elements in + a tree view; + With that module, user can select a custom number of items to display; + +Technical information: +---------------------- + * replace a select element by an input with datalist option. That allows + to set a custom value, or to select an option. (same options as before: + 80 / 200 / 500 / 2000 / unlimited); + + * WARNING: 'Datalist' is a HTML5 tag; If your browser is not HTML5 + compliant, the options will not be displayed (but it is possible for + user to select manually a value); + See browser Support: http://www.w3schools.com/tags/tag_datalist.asp + +Copyright, Author and Licence: +------------------------------ + * Copyright: + * 2015-Today, Akretion; + * Author: + * Sylvain LE GAL (https://twitter.com/legalsylvain); + * Licence: AGPL-3 (http://www.gnu.org/licenses/)""", + 'author': "GRAP,Odoo Community Association (OCA)", + 'website': 'http://www.grap.coop', + 'license': 'AGPL-3', + 'depends': [ + 'web', + ], + 'js': [ + 'static/src/js/web_custom_search_quantity.js', + ], + 'css': [ + "static/src/css/web_custom_search_quantity.css", + ], +} diff --git a/web_custom_search_quantity/i18n/fr.po b/web_custom_search_quantity/i18n/fr.po new file mode 100644 index 00000000..181fbee1 --- /dev/null +++ b/web_custom_search_quantity/i18n/fr.po @@ -0,0 +1,23 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-06-07 23:26+0000\n" +"PO-Revision-Date: 2015-06-07 23:26+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: web_custom_search_quantity +#. openerp-web +#: code:addons/web_custom_search_quantity/static/src/js/web_custom_search_quantity.js:56 +#, python-format +msgid "0 (Unlimited)" +msgstr "0 (Illimité)" + diff --git a/web_custom_search_quantity/i18n/web_custom_search_quantity.pot b/web_custom_search_quantity/i18n/web_custom_search_quantity.pot new file mode 100644 index 00000000..82ba3e07 --- /dev/null +++ b/web_custom_search_quantity/i18n/web_custom_search_quantity.pot @@ -0,0 +1,23 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-06-07 23:25+0000\n" +"PO-Revision-Date: 2015-06-07 23:25+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: web_custom_search_quantity +#. openerp-web +#: code:addons/web_custom_search_quantity/static/src/js/web_custom_search_quantity.js:56 +#, python-format +msgid "0 (Unlimited)" +msgstr "" + diff --git a/web_custom_search_quantity/static/src/css/web_custom_search_quantity.css b/web_custom_search_quantity/static/src/css/web_custom_search_quantity.css new file mode 100644 index 00000000..b42d7b45 --- /dev/null +++ b/web_custom_search_quantity/static/src/css/web_custom_search_quantity.css @@ -0,0 +1,22 @@ +/****************************************************************************** + Web - Custom Search Quantity module for Odoo + Copyright (C) 2015-Today Akretion (http://www.akretion.com) + @author Sylvain LE GAL (https://twitter.com/legalsylvain) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +******************************************************************************/ + +.custom_search_quantity { + width:50px; +} \ No newline at end of file diff --git a/web_custom_search_quantity/static/src/img/icon.png b/web_custom_search_quantity/static/src/img/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..0d11906dfcb99614f651e6360ab5e8120784b29d GIT binary patch literal 3333 zcmchacQhN^|HorIW{XNSYE-DvqV{a8+FD7~RwGvE5@OZXqG}T(DnT{0Mm_N;6?u%J zRIRG28WEe6(1=l+pZ?D8zu({A?>*;p-{;=@IiK^n=e*8&-E^{?6USg1 zf1lvT9)SqJ4R3!>1lYpQ!xv$V@bC^t^&oTrfHQFx#y4!k3fBsw16&X--TKtkV%-Cb znj-WTRyy~a757!eAJ%L)yC$B>cELy~M2Y;kl-^yHl!%tnDY>+aq|n~}qxc~?`zzqq zC&V~wCWzpbAkzDW@63KIIcgL?n`~+5zvH8IR7U0i@|}f76HXeJKDb$+J-oW7OAU{S zET-=jO^1J}dCMuz%5{IpcY>*_AI}Qbz6r=K{V&Trt5)c$Alf`(m|pzie(X&cB1F{A z&Q483BjX`aK9xXFh-(M4u&_8{x`Gd@ttI)}=NXpa9{|`lvw@@v0^v<yf|ZyEDbgU%y7A4ZM>-Emc%hWNT|{%?SjPg)S5j5QHLPaCEZE~M z{Q!TtH)L-39u_m)eNXMCN1j%1UuQ4tJ*?j!ft048m_yzk8B3 zPVX3;L4x^QLlTAi-u>ez?CuEgl7Sn&g{P8YR850egf2)lJ|7bkllU>Ek1qlq;RnJr z9(8Ds#%r}??uuQKjA)c82QFR^;Np)tr}q$RzondWU%volYNn#=%f1xY5BZSz(2X~l zLQXz@Ef6_%fSTUB=3c~exL$Iemf8-&qGmgC$$ow^l zC~W(PbioTHP#ax-0~f!!j~gn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9-@ag)IzwTm8z|xASBT@3Ky!$Sik>=bz}{j$ z^${rDl=GRPQ)X}-Cv-SKOQey4jM9VKGyS7VX;XtvOiY+d@*DjA=C{9jkE>uS5XKB0 z?xgQf{ivZ$L8i&$8PW-Sk#`>t){CW_bE)(3>-p3x`840H74ID{8yK|S)|#E62{|c` z_w2P|&JvLV^xR?2DxB*LHHou{rSy2+rY{*#0T#XjAQ#fpYtG1$an1U5&+T_~qWo}eFrFmmr!h4ertsN8`_F~w!@}=D_@eXD% zj7k@Cr>V*~Z44=HY%4x;KPKO1v^9XV5CWbKxmdi!lclEIK_n#+sbwutMR!i2{)}n3 z6rF>7s7;lbUK)30sv13#c}xjACmrXrgK9mT_Z=T0VaT9`T1AaFRA<>hYwyXCfHD~| z@Wof<(;eFW;z5O3Kea8%C8<(!Ldwr44lph~5`SlY^z%(xtOdd4Uu!vhnf-(V@6Mg9 zd(T8^P(r2bgvNZEE_M!1rp&hCNmVas&#WFNgtzNx-le;pyltN&3M?EMqxuq-;8ic1+sk7y{nRxHonCwqR69j7#`x9UXeG zT5it7(c!P#&ik0viSe4gUYV!v#9jys+q2wC0pl- zJXxzti!#TSC)t@new2&X$%AFTX$n;PS=%^Tm1bX;QP-adq_&ndcH{t+ci z!<`9Os+GG5Lop}4T%g~0DiE7378P0cDv>wZUykTHgI~UU@gTZc8 zaoVcKOO;nYV741@U%vYGe~%+Zli}Jb%J7C2Fwp+KuM_8+{?b$Xi7LE%c zF;P32yUtPd;;z7ZXRa+ACYT*>vFW06HVKVrh+Z9fF({ER9rXSr$7Us4$qwk~Q-L)w zvG@b7CBNeeyxcmM9eafeN7-9KRxbR6ZmyVFEKI7`n&(4<^bx AeE. +******************************************************************************/ + +openerp.web_custom_search_quantity = function (instance) { + module = instance.web; + _t = module._t; + + /*************************************************************************** + Extend the widget 'instance.web.ListView' to replace the select tag by an + input with datalist option. + ***************************************************************************/ + module.ListView.include({ + + /** + * Overload 'load_list' function: + */ + load_list: function(data) { + var self = this; + this._super.apply(this, arguments); + + if (this.$pager){ + // unbind previous function that added a select tag + this.$pager.find('.oe_list_pager_state').unbind("click"); + + // bind a new function on click, that add a input type select + this.$pager.find('.oe_list_pager_state').click(function (e) { + e.stopPropagation(); + var $this = $(this); + var $select = $('') + .appendTo($this.empty()) + .click(function (e) {e.stopPropagation();}) + .append( + '' + + '') + .change(function () { + var val = parseInt($select.val(), 10); + if (!isNaN(val)){ + if (val == 0){ + self._limit = null; + } + else{ + self._limit = val; + } + self.page = 0; + self.reload_content(); + } + }).blur(function() { + $(this).trigger('change'); + }) + .val(self._limit || '0'); + }); + } + }, + }); +}; From 043766536da897f7da5673d92cf03c61a9c81527 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Mon, 8 Jun 2015 02:00:03 +0200 Subject: [PATCH 06/11] [IMP] UX. add focus and validation on enter; --- .../static/src/js/web_custom_search_quantity.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/web_custom_search_quantity/static/src/js/web_custom_search_quantity.js b/web_custom_search_quantity/static/src/js/web_custom_search_quantity.js index 9e437544..7883cf42 100644 --- a/web_custom_search_quantity/static/src/js/web_custom_search_quantity.js +++ b/web_custom_search_quantity/static/src/js/web_custom_search_quantity.js @@ -68,6 +68,12 @@ openerp.web_custom_search_quantity = function (instance) { }).blur(function() { $(this).trigger('change'); }) + .keypress(function(e) { + if(e.which == 13) { + $(this).trigger('change'); + } + }) + .focus() .val(self._limit || '0'); }); } From 0e9d60e2384cad224addac8e7b4442c5ccc5572e Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Fri, 19 Jun 2015 10:16:44 +0200 Subject: [PATCH 07/11] [REF] remove useless licence in an empty file --- web_custom_search_quantity/__init__.py | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/web_custom_search_quantity/__init__.py b/web_custom_search_quantity/__init__.py index aa7377eb..dae354a6 100644 --- a/web_custom_search_quantity/__init__.py +++ b/web_custom_search_quantity/__init__.py @@ -1,21 +1 @@ # -*- encoding: utf-8 -*- -############################################################################## -# -# Web - Custom Search Quantity module for Odoo -# Copyright (C) 2015-Today Akretion (http://www.akretion.com) -# @author Sylvain LE GAL (https://twitter.com/legalsylvain) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## From 4eea2a571fedfb601ebbc092f21120b58a123d19 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Wed, 24 Jun 2015 00:03:18 +0200 Subject: [PATCH 08/11] [REF] Fix Author name --- web_custom_search_quantity/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_custom_search_quantity/__openerp__.py b/web_custom_search_quantity/__openerp__.py index f8e308b4..b66b2f79 100644 --- a/web_custom_search_quantity/__openerp__.py +++ b/web_custom_search_quantity/__openerp__.py @@ -52,7 +52,7 @@ Copyright, Author and Licence: * Author: * Sylvain LE GAL (https://twitter.com/legalsylvain); * Licence: AGPL-3 (http://www.gnu.org/licenses/)""", - 'author': "GRAP,Odoo Community Association (OCA)", + 'author': "Akretion,Odoo Community Association (OCA)", 'website': 'http://www.grap.coop', 'license': 'AGPL-3', 'depends': [ From 7a75339881708fa75f61d66b60c417deef0c237e Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Sat, 27 Jun 2015 10:06:28 +0200 Subject: [PATCH 09/11] [FIX] remove blink effect in Chrome / Chromium; --- .../static/src/js/web_custom_search_quantity.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/web_custom_search_quantity/static/src/js/web_custom_search_quantity.js b/web_custom_search_quantity/static/src/js/web_custom_search_quantity.js index 7883cf42..428c9ee1 100644 --- a/web_custom_search_quantity/static/src/js/web_custom_search_quantity.js +++ b/web_custom_search_quantity/static/src/js/web_custom_search_quantity.js @@ -42,7 +42,7 @@ openerp.web_custom_search_quantity = function (instance) { this.$pager.find('.oe_list_pager_state').click(function (e) { e.stopPropagation(); var $this = $(this); - var $select = $('') + var $select = $('') .appendTo($this.empty()) .click(function (e) {e.stopPropagation();}) .append( @@ -74,7 +74,6 @@ openerp.web_custom_search_quantity = function (instance) { } }) .focus() - .val(self._limit || '0'); }); } }, From 43e8262e85c9964cfb5b6702edab9a05f7dd8481 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Sat, 27 Jun 2015 12:47:27 +0200 Subject: [PATCH 10/11] [REF] renaming 'web_custom_search_quantity' into 'web_listview_custom_element_number'; --- .../__init__.py | 0 .../__openerp__.py | 8 ++++---- .../i18n/fr.po | 4 ++-- .../i18n/web_listview_custom_element_number.pot | 4 ++-- .../src/css/web_listview_custom_element_number.css | 6 +++--- .../static/src/img/icon.png | Bin .../src/js/web_listview_custom_element_number.js | 6 +++--- 7 files changed, 14 insertions(+), 14 deletions(-) rename {web_custom_search_quantity => web_listview_custom_element_number}/__init__.py (100%) rename {web_custom_search_quantity => web_listview_custom_element_number}/__openerp__.py (90%) rename {web_custom_search_quantity => web_listview_custom_element_number}/i18n/fr.po (77%) rename web_custom_search_quantity/i18n/web_custom_search_quantity.pot => web_listview_custom_element_number/i18n/web_listview_custom_element_number.pot (76%) rename web_custom_search_quantity/static/src/css/web_custom_search_quantity.css => web_listview_custom_element_number/static/src/css/web_listview_custom_element_number.css (91%) rename {web_custom_search_quantity => web_listview_custom_element_number}/static/src/img/icon.png (100%) rename web_custom_search_quantity/static/src/js/web_custom_search_quantity.js => web_listview_custom_element_number/static/src/js/web_listview_custom_element_number.js (94%) diff --git a/web_custom_search_quantity/__init__.py b/web_listview_custom_element_number/__init__.py similarity index 100% rename from web_custom_search_quantity/__init__.py rename to web_listview_custom_element_number/__init__.py diff --git a/web_custom_search_quantity/__openerp__.py b/web_listview_custom_element_number/__openerp__.py similarity index 90% rename from web_custom_search_quantity/__openerp__.py rename to web_listview_custom_element_number/__openerp__.py index b66b2f79..12aea3ce 100644 --- a/web_custom_search_quantity/__openerp__.py +++ b/web_listview_custom_element_number/__openerp__.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Web - Custom Search Quantity module for Odoo +# Web - Custom Element Number in ListView module for Odoo # Copyright (C) 2015-Today Akretion (http://www.akretion.com) # @author Sylvain LE GAL (https://twitter.com/legalsylvain) # @@ -21,7 +21,7 @@ ############################################################################## { - 'name': 'Web - Custom Search Quantity', + 'name': 'Web - Custom Element Number in ListView', 'version': '1.0', 'category': 'web', 'description': """ @@ -59,9 +59,9 @@ Copyright, Author and Licence: 'web', ], 'js': [ - 'static/src/js/web_custom_search_quantity.js', + 'static/src/js/web_listview_custom_element_number.js', ], 'css': [ - "static/src/css/web_custom_search_quantity.css", + 'static/src/css/web_listview_custom_element_number.css', ], } diff --git a/web_custom_search_quantity/i18n/fr.po b/web_listview_custom_element_number/i18n/fr.po similarity index 77% rename from web_custom_search_quantity/i18n/fr.po rename to web_listview_custom_element_number/i18n/fr.po index 181fbee1..6f8db58e 100644 --- a/web_custom_search_quantity/i18n/fr.po +++ b/web_listview_custom_element_number/i18n/fr.po @@ -14,9 +14,9 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" -#. module: web_custom_search_quantity +#. module: web_listview_custom_element_number #. openerp-web -#: code:addons/web_custom_search_quantity/static/src/js/web_custom_search_quantity.js:56 +#: code:addons/web_listview_custom_element_number/static/src/js/web_listview_custom_element_number.js:56 #, python-format msgid "0 (Unlimited)" msgstr "0 (Illimité)" diff --git a/web_custom_search_quantity/i18n/web_custom_search_quantity.pot b/web_listview_custom_element_number/i18n/web_listview_custom_element_number.pot similarity index 76% rename from web_custom_search_quantity/i18n/web_custom_search_quantity.pot rename to web_listview_custom_element_number/i18n/web_listview_custom_element_number.pot index 82ba3e07..fcebc90a 100644 --- a/web_custom_search_quantity/i18n/web_custom_search_quantity.pot +++ b/web_listview_custom_element_number/i18n/web_listview_custom_element_number.pot @@ -14,9 +14,9 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" -#. module: web_custom_search_quantity +#. module: web_listview_custom_element_number #. openerp-web -#: code:addons/web_custom_search_quantity/static/src/js/web_custom_search_quantity.js:56 +#: code:addons/web_listview_custom_element_number/static/src/js/web_listview_custom_element_number.js:56 #, python-format msgid "0 (Unlimited)" msgstr "" diff --git a/web_custom_search_quantity/static/src/css/web_custom_search_quantity.css b/web_listview_custom_element_number/static/src/css/web_listview_custom_element_number.css similarity index 91% rename from web_custom_search_quantity/static/src/css/web_custom_search_quantity.css rename to web_listview_custom_element_number/static/src/css/web_listview_custom_element_number.css index b42d7b45..c3a75be5 100644 --- a/web_custom_search_quantity/static/src/css/web_custom_search_quantity.css +++ b/web_listview_custom_element_number/static/src/css/web_listview_custom_element_number.css @@ -1,5 +1,5 @@ /****************************************************************************** - Web - Custom Search Quantity module for Odoo + Web - Custom Element Number in ListView module for Odoo Copyright (C) 2015-Today Akretion (http://www.akretion.com) @author Sylvain LE GAL (https://twitter.com/legalsylvain) @@ -17,6 +17,6 @@ along with this program. If not, see . ******************************************************************************/ -.custom_search_quantity { +.custom_element_number { width:50px; -} \ No newline at end of file +} diff --git a/web_custom_search_quantity/static/src/img/icon.png b/web_listview_custom_element_number/static/src/img/icon.png similarity index 100% rename from web_custom_search_quantity/static/src/img/icon.png rename to web_listview_custom_element_number/static/src/img/icon.png diff --git a/web_custom_search_quantity/static/src/js/web_custom_search_quantity.js b/web_listview_custom_element_number/static/src/js/web_listview_custom_element_number.js similarity index 94% rename from web_custom_search_quantity/static/src/js/web_custom_search_quantity.js rename to web_listview_custom_element_number/static/src/js/web_listview_custom_element_number.js index 428c9ee1..5e6ecfb5 100644 --- a/web_custom_search_quantity/static/src/js/web_custom_search_quantity.js +++ b/web_listview_custom_element_number/static/src/js/web_listview_custom_element_number.js @@ -1,5 +1,5 @@ /****************************************************************************** - Web - Custom Search Quantity module for Odoo + Web - Custom Element Number in ListView module for Odoo Copyright (C) 2015-Today Akretion (http://www.akretion.com) @author Sylvain LE GAL (https://twitter.com/legalsylvain) @@ -17,7 +17,7 @@ along with this program. If not, see . ******************************************************************************/ -openerp.web_custom_search_quantity = function (instance) { +openerp.web_listview_custom_element_number = function (instance) { module = instance.web; _t = module._t; @@ -42,7 +42,7 @@ openerp.web_custom_search_quantity = function (instance) { this.$pager.find('.oe_list_pager_state').click(function (e) { e.stopPropagation(); var $this = $(this); - var $select = $('') + var $select = $('') .appendTo($this.empty()) .click(function (e) {e.stopPropagation();}) .append( From e93ab3fa6490d5af3bbe9c32dbf4381d6ff0201d Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Fri, 3 Jul 2015 16:21:08 +0200 Subject: [PATCH 11/11] [REF] add roadmap; --- web_listview_custom_element_number/__openerp__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web_listview_custom_element_number/__openerp__.py b/web_listview_custom_element_number/__openerp__.py index 12aea3ce..6bf3fc3a 100644 --- a/web_listview_custom_element_number/__openerp__.py +++ b/web_listview_custom_element_number/__openerp__.py @@ -45,6 +45,11 @@ Technical information: user to select manually a value); See browser Support: http://www.w3schools.com/tags/tag_datalist.asp +Roadmap: +-------- + * When pressing Esc key, it could be user friendly to return to the + previous state (before editing the quantity). + Copyright, Author and Licence: ------------------------------ * Copyright: