Merge pull request #559 from legalsylvain/9.0_PORT_web_listview_custom_element_number
[PORT] 9.0 web_listview_custom_element_numberpull/560/head
-
83web_listview_custom_element_number/README.rst
-
33web_listview_custom_element_number/__openerp__.py
-
26web_listview_custom_element_number/i18n/ar.po
-
26web_listview_custom_element_number/i18n/de.po
-
26web_listview_custom_element_number/i18n/es.po
-
26web_listview_custom_element_number/i18n/fi.po
-
19web_listview_custom_element_number/i18n/fr.po
-
26web_listview_custom_element_number/i18n/it.po
-
26web_listview_custom_element_number/i18n/pt_BR.po
-
26web_listview_custom_element_number/i18n/sl.po
-
26web_listview_custom_element_number/i18n/tr.po
-
4web_listview_custom_element_number/i18n/web_listview_custom_element_number.pot
-
24web_listview_custom_element_number/static/src/css/web_listview_custom_element_number.css
-
BINweb_listview_custom_element_number/static/src/img/screnshot_chrome.png
-
BINweb_listview_custom_element_number/static/src/img/screnshot_firefox.png
-
BINweb_listview_custom_element_number/static/src/img/screnshot_partner_limit.png
-
125web_listview_custom_element_number/static/src/js/web_listview_custom_element_number.js
-
39web_listview_custom_element_number/views/templates.xml
@ -0,0 +1,26 @@ |
|||
# Translation of Odoo Server. |
|||
# This file contains the translation of the following modules: |
|||
# * web_listview_custom_element_number |
|||
# |
|||
# Translators: |
|||
# SaFi J. <safi2266@gmail.com>, 2015 |
|||
msgid "" |
|||
msgstr "" |
|||
"Project-Id-Version: web (8.0)\n" |
|||
"Report-Msgid-Bugs-To: \n" |
|||
"POT-Creation-Date: 2015-12-16 07:41+0000\n" |
|||
"PO-Revision-Date: 2015-12-16 17:31+0000\n" |
|||
"Last-Translator: SaFi J. <safi2266@gmail.com>\n" |
|||
"Language-Team: Arabic (http://www.transifex.com/oca/OCA-web-8-0/language/ar/)\n" |
|||
"MIME-Version: 1.0\n" |
|||
"Content-Type: text/plain; charset=UTF-8\n" |
|||
"Content-Transfer-Encoding: \n" |
|||
"Language: ar\n" |
|||
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" |
|||
|
|||
#. module: web_listview_custom_element_number |
|||
#. openerp-web |
|||
#: code:addons/web_listview_custom_element_number/static/src/js/web_listview_custom_element_number.js:42 |
|||
#, python-format |
|||
msgid "Unlimited" |
|||
msgstr "بلاحدود" |
@ -0,0 +1,26 @@ |
|||
# Translation of Odoo Server. |
|||
# This file contains the translation of the following modules: |
|||
# * web_listview_custom_element_number |
|||
# |
|||
# Translators: |
|||
# Rudolf Schnapka <rs@techno-flex.de>, 2016 |
|||
msgid "" |
|||
msgstr "" |
|||
"Project-Id-Version: web (8.0)\n" |
|||
"Report-Msgid-Bugs-To: \n" |
|||
"POT-Creation-Date: 2016-01-10 07:31+0000\n" |
|||
"PO-Revision-Date: 2016-01-18 20:15+0000\n" |
|||
"Last-Translator: Rudolf Schnapka <rs@techno-flex.de>\n" |
|||
"Language-Team: German (http://www.transifex.com/oca/OCA-web-8-0/language/de/)\n" |
|||
"MIME-Version: 1.0\n" |
|||
"Content-Type: text/plain; charset=UTF-8\n" |
|||
"Content-Transfer-Encoding: \n" |
|||
"Language: de\n" |
|||
"Plural-Forms: nplurals=2; plural=(n != 1);\n" |
|||
|
|||
#. module: web_listview_custom_element_number |
|||
#. openerp-web |
|||
#: code:addons/web_listview_custom_element_number/static/src/js/web_listview_custom_element_number.js:42 |
|||
#, python-format |
|||
msgid "Unlimited" |
|||
msgstr "Unbegrenzt" |
@ -0,0 +1,26 @@ |
|||
# Translation of Odoo Server. |
|||
# This file contains the translation of the following modules: |
|||
# * web_listview_custom_element_number |
|||
# |
|||
# Translators: |
|||
# Pedro M. Baeza <pedro.baeza@gmail.com>, 2015 |
|||
msgid "" |
|||
msgstr "" |
|||
"Project-Id-Version: web (8.0)\n" |
|||
"Report-Msgid-Bugs-To: \n" |
|||
"POT-Creation-Date: 2015-11-23 13:46+0000\n" |
|||
"PO-Revision-Date: 2015-11-07 11:28+0000\n" |
|||
"Last-Translator: Pedro M. Baeza <pedro.baeza@gmail.com>\n" |
|||
"Language-Team: Spanish (http://www.transifex.com/oca/OCA-web-8-0/language/es/)\n" |
|||
"MIME-Version: 1.0\n" |
|||
"Content-Type: text/plain; charset=UTF-8\n" |
|||
"Content-Transfer-Encoding: \n" |
|||
"Language: es\n" |
|||
"Plural-Forms: nplurals=2; plural=(n != 1);\n" |
|||
|
|||
#. module: web_listview_custom_element_number |
|||
#. openerp-web |
|||
#: code:addons/web_listview_custom_element_number/static/src/js/web_listview_custom_element_number.js:42 |
|||
#, python-format |
|||
msgid "Unlimited" |
|||
msgstr "Ilimitado" |
@ -0,0 +1,26 @@ |
|||
# Translation of Odoo Server. |
|||
# This file contains the translation of the following modules: |
|||
# * web_listview_custom_element_number |
|||
# |
|||
# Translators: |
|||
# Jarmo Kortetjärvi <jarmo.kortetjarvi@gmail.com>, 2016 |
|||
msgid "" |
|||
msgstr "" |
|||
"Project-Id-Version: web (8.0)\n" |
|||
"Report-Msgid-Bugs-To: \n" |
|||
"POT-Creation-Date: 2016-01-10 07:31+0000\n" |
|||
"PO-Revision-Date: 2016-02-01 09:54+0000\n" |
|||
"Last-Translator: Jarmo Kortetjärvi <jarmo.kortetjarvi@gmail.com>\n" |
|||
"Language-Team: Finnish (http://www.transifex.com/oca/OCA-web-8-0/language/fi/)\n" |
|||
"MIME-Version: 1.0\n" |
|||
"Content-Type: text/plain; charset=UTF-8\n" |
|||
"Content-Transfer-Encoding: \n" |
|||
"Language: fi\n" |
|||
"Plural-Forms: nplurals=2; plural=(n != 1);\n" |
|||
|
|||
#. module: web_listview_custom_element_number |
|||
#. openerp-web |
|||
#: code:addons/web_listview_custom_element_number/static/src/js/web_listview_custom_element_number.js:42 |
|||
#, python-format |
|||
msgid "Unlimited" |
|||
msgstr "Rajaton" |
@ -1,23 +1,24 @@ |
|||
# Translation of OpenERP Server. |
|||
# Translation of Odoo Server. |
|||
# This file contains the translation of the following modules: |
|||
# * web_listview_custom_element_number |
|||
# |
|||
msgid "" |
|||
msgstr "" |
|||
"Project-Id-Version: OpenERP Server 7.0\n" |
|||
"Project-Id-Version: Odoo Server 9.0c\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" |
|||
"POT-Creation-Date: 2017-02-17 22:55+0000\n" |
|||
"PO-Revision-Date: 2017-02-17 22:55+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" |
|||
"Language: fr\n" |
|||
"Plural-Forms: nplurals=2; plural=(n > 1);\n" |
|||
|
|||
#. module: web_listview_custom_element_number |
|||
#. openerp-web |
|||
#: code:addons/web_listview_custom_element_number/static/src/js/web_listview_custom_element_number.js:56 |
|||
#: code:addons/web_listview_custom_element_number/static/src/js/web_listview_custom_element_number.js:42 |
|||
#, python-format |
|||
msgid "0 (Unlimited)" |
|||
msgstr "0 (Illimité)" |
|||
|
|||
msgid "Unlimited" |
|||
msgstr "Illimité" |
@ -0,0 +1,26 @@ |
|||
# Translation of Odoo Server. |
|||
# This file contains the translation of the following modules: |
|||
# * web_listview_custom_element_number |
|||
# |
|||
# Translators: |
|||
# Paolo Valier, 2016 |
|||
msgid "" |
|||
msgstr "" |
|||
"Project-Id-Version: web (8.0)\n" |
|||
"Report-Msgid-Bugs-To: \n" |
|||
"POT-Creation-Date: 2016-03-17 07:29+0000\n" |
|||
"PO-Revision-Date: 2016-03-19 10:10+0000\n" |
|||
"Last-Translator: Paolo Valier\n" |
|||
"Language-Team: Italian (http://www.transifex.com/oca/OCA-web-8-0/language/it/)\n" |
|||
"MIME-Version: 1.0\n" |
|||
"Content-Type: text/plain; charset=UTF-8\n" |
|||
"Content-Transfer-Encoding: \n" |
|||
"Language: it\n" |
|||
"Plural-Forms: nplurals=2; plural=(n != 1);\n" |
|||
|
|||
#. module: web_listview_custom_element_number |
|||
#. openerp-web |
|||
#: code:addons/web_listview_custom_element_number/static/src/js/web_listview_custom_element_number.js:42 |
|||
#, python-format |
|||
msgid "Unlimited" |
|||
msgstr "Illimitato" |
@ -0,0 +1,26 @@ |
|||
# Translation of Odoo Server. |
|||
# This file contains the translation of the following modules: |
|||
# * web_listview_custom_element_number |
|||
# |
|||
# Translators: |
|||
# danimaribeiro <danimaribeiro@gmail.com>, 2016 |
|||
msgid "" |
|||
msgstr "" |
|||
"Project-Id-Version: web (8.0)\n" |
|||
"Report-Msgid-Bugs-To: \n" |
|||
"POT-Creation-Date: 2016-03-11 02:17+0000\n" |
|||
"PO-Revision-Date: 2016-03-05 16:20+0000\n" |
|||
"Last-Translator: danimaribeiro <danimaribeiro@gmail.com>\n" |
|||
"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-web-8-0/language/pt_BR/)\n" |
|||
"MIME-Version: 1.0\n" |
|||
"Content-Type: text/plain; charset=UTF-8\n" |
|||
"Content-Transfer-Encoding: \n" |
|||
"Language: pt_BR\n" |
|||
"Plural-Forms: nplurals=2; plural=(n > 1);\n" |
|||
|
|||
#. module: web_listview_custom_element_number |
|||
#. openerp-web |
|||
#: code:addons/web_listview_custom_element_number/static/src/js/web_listview_custom_element_number.js:42 |
|||
#, python-format |
|||
msgid "Unlimited" |
|||
msgstr "ilimitado" |
@ -0,0 +1,26 @@ |
|||
# Translation of Odoo Server. |
|||
# This file contains the translation of the following modules: |
|||
# * web_listview_custom_element_number |
|||
# |
|||
# Translators: |
|||
# Matjaž Mozetič <m.mozetic@matmoz.si>, 2015 |
|||
msgid "" |
|||
msgstr "" |
|||
"Project-Id-Version: web (8.0)\n" |
|||
"Report-Msgid-Bugs-To: \n" |
|||
"POT-Creation-Date: 2015-11-23 13:46+0000\n" |
|||
"PO-Revision-Date: 2015-11-08 05:45+0000\n" |
|||
"Last-Translator: Matjaž Mozetič <m.mozetic@matmoz.si>\n" |
|||
"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-web-8-0/language/sl/)\n" |
|||
"MIME-Version: 1.0\n" |
|||
"Content-Type: text/plain; charset=UTF-8\n" |
|||
"Content-Transfer-Encoding: \n" |
|||
"Language: sl\n" |
|||
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" |
|||
|
|||
#. module: web_listview_custom_element_number |
|||
#. openerp-web |
|||
#: code:addons/web_listview_custom_element_number/static/src/js/web_listview_custom_element_number.js:42 |
|||
#, python-format |
|||
msgid "Unlimited" |
|||
msgstr "neomejeno" |
@ -0,0 +1,26 @@ |
|||
# Translation of Odoo Server. |
|||
# This file contains the translation of the following modules: |
|||
# * web_listview_custom_element_number |
|||
# |
|||
# Translators: |
|||
# Ahmet Altınışık <aaltinisik@altinkaya.com.tr>, 2015 |
|||
msgid "" |
|||
msgstr "" |
|||
"Project-Id-Version: web (8.0)\n" |
|||
"Report-Msgid-Bugs-To: \n" |
|||
"POT-Creation-Date: 2016-01-08 21:34+0000\n" |
|||
"PO-Revision-Date: 2015-12-30 21:59+0000\n" |
|||
"Last-Translator: Ahmet Altınışık <aaltinisik@altinkaya.com.tr>\n" |
|||
"Language-Team: Turkish (http://www.transifex.com/oca/OCA-web-8-0/language/tr/)\n" |
|||
"MIME-Version: 1.0\n" |
|||
"Content-Type: text/plain; charset=UTF-8\n" |
|||
"Content-Transfer-Encoding: \n" |
|||
"Language: tr\n" |
|||
"Plural-Forms: nplurals=2; plural=(n > 1);\n" |
|||
|
|||
#. module: web_listview_custom_element_number |
|||
#. openerp-web |
|||
#: code:addons/web_listview_custom_element_number/static/src/js/web_listview_custom_element_number.js:42 |
|||
#, python-format |
|||
msgid "Unlimited" |
|||
msgstr "sınırsız" |
@ -1,22 +1,10 @@ |
|||
/****************************************************************************** |
|||
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) |
|||
|
|||
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 <http://www.gnu.org/licenses/>. |
|||
******************************************************************************/ |
|||
/* |
|||
Copyright (C) 2015-Today Akretion (http://www.akretion.com) |
|||
@author: Sylvain LE GAL (https://twitter.com/legalsylvain) |
|||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
*/ |
|||
|
|||
.custom_element_number { |
|||
width:80px; |
|||
height: 29px; |
|||
} |
Before Width: 460 | Height: 180 | Size: 9.6 KiB After Width: 270 | Height: 177 | Size: 6.1 KiB |
Before Width: 460 | Height: 180 | Size: 15 KiB After Width: 260 | Height: 154 | Size: 7.2 KiB |
Before Width: 745 | Height: 243 | Size: 28 KiB After Width: 744 | Height: 251 | Size: 27 KiB |
@ -1,81 +1,72 @@ |
|||
/****************************************************************************** |
|||
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)
|
|||
/* |
|||
Copyright (C) 2015-Today Akretion (http://www.akretion.com)
|
|||
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
|
|||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|||
*/ |
|||
|
|||
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. |
|||
odoo.define('web.web_listview_custom_element_number',function (require) { |
|||
"use strict"; |
|||
|
|||
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. |
|||
var core = require('web.core'); |
|||
var ListView = require('web.ListView'); |
|||
|
|||
You should have received a copy of the GNU Affero General Public License |
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
******************************************************************************/ |
|||
|
|||
openerp.web_listview_custom_element_number = function (instance) { |
|||
module = instance.web; |
|||
_t = module._t; |
|||
var _t = core._t; |
|||
|
|||
/*************************************************************************** |
|||
Extend the widget 'instance.web.ListView' to replace the select tag by an |
|||
Extend the widget 'web.ListView' to replace the select tag by an |
|||
input with datalist option. |
|||
***************************************************************************/ |
|||
module.ListView.include({ |
|||
ListView.include({ |
|||
|
|||
/** |
|||
* Overload 'load_list' function: |
|||
*/ |
|||
load_list: function(data) { |
|||
render_pager: function($node) { |
|||
// Call Original function
|
|||
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"); |
|||
this._super($node); |
|||
|
|||
// 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 = $('<input list="page_value" class="custom_element_number" type="text" placeholder="' + (self._limit || '0') + '">') |
|||
.appendTo($this.empty()) |
|||
.click(function (e) {e.stopPropagation();}) |
|||
.append( |
|||
'<datalist id="page_value">' + |
|||
'<option value="80">' + |
|||
'<option value="200">' + |
|||
'<option value="500">' + |
|||
'<option value="2000">' + |
|||
'<option value="0" label="'+_t("0 (Unlimited)") + '">' + |
|||
'</datalist>') |
|||
.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(); |
|||
// 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 = $('<input list="page_value" class="custom_element_number" type="text" placeholder="' + (self._limit || '0') + '">') |
|||
.appendTo($this.empty()) |
|||
.click(function (e) {e.stopPropagation();}) |
|||
.append( |
|||
'<datalist id="page_value">' + |
|||
'<option value="80">' + |
|||
'<option value="200">' + |
|||
'<option value="500">' + |
|||
'<option value="2000">' + |
|||
'<option value="0" label="'+_t("Unlimited") + '">' + |
|||
'</datalist>') |
|||
.change(function () { |
|||
var val = parseInt($select.val(), 10); |
|||
if (!isNaN(val)){ |
|||
if (val == 0){ |
|||
self._limit = null; |
|||
} |
|||
}).blur(function() { |
|||
$(this).trigger('change'); |
|||
}) |
|||
.keypress(function(e) { |
|||
if(e.which == 13) { |
|||
$(this).trigger('change'); |
|||
else{ |
|||
self._limit = val; |
|||
} |
|||
}) |
|||
.focus() |
|||
}); |
|||
} |
|||
self.page = 0; |
|||
self.reload_content(); |
|||
} |
|||
}) |
|||
.blur(function() { |
|||
$(this).trigger('change'); |
|||
}) |
|||
.keypress(function(e) { |
|||
if(e.which == 13) { |
|||
$(this).trigger('change'); |
|||
} |
|||
}) |
|||
.bind('select', function () { |
|||
$(this).trigger('change'); |
|||
}) |
|||
.focus() |
|||
}); |
|||
}, |
|||
}); |
|||
}; |
|||
}); |
@ -1,30 +1,17 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!--*************************************************************************** |
|||
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) |
|||
<!-- |
|||
Copyright (C) 2015-Today Akretion (http://www.akretion.com) |
|||
@author: Sylvain LE GAL (https://twitter.com/legalsylvain) |
|||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
--> |
|||
|
|||
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. |
|||
<odoo> |
|||
|
|||
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. |
|||
<template id="assets_backend" name="web_listview_custom_element_number assets" inherit_id="web.assets_backend"> |
|||
<xpath expr="." position="inside"> |
|||
<link rel="stylesheet" href="/web_listview_custom_element_number/static/src/css/web_listview_custom_element_number.css"/> |
|||
<script type="text/javascript" src="/web_listview_custom_element_number/static/src/js/web_listview_custom_element_number.js"></script> |
|||
</xpath> |
|||
</template> |
|||
|
|||
You should have received a copy of the GNU Affero General Public License |
|||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
****************************************************************************--> |
|||
|
|||
<openerp> |
|||
<data> |
|||
<template id="assets_backend" name="web_listview_custom_element_number assets" inherit_id="web.assets_backend"> |
|||
<xpath expr="." position="inside"> |
|||
<link rel="stylesheet" href="/web_listview_custom_element_number/static/src/css/web_listview_custom_element_number.css"/> |
|||
<script type="text/javascript" src="/web_listview_custom_element_number/static/src/js/web_listview_custom_element_number.js"></script> |
|||
</xpath> |
|||
</template> |
|||
</data> |
|||
</openerp> |
|||
</odoo> |