forked from Techsystech/web
[14.0][MIG] web_group_expand
parent
8c147aad9c
commit
a1892f7d8c
|
@ -14,13 +14,13 @@ Group Expand Buttons
|
||||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||||
:alt: License: AGPL-3
|
:alt: License: AGPL-3
|
||||||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
|
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
|
||||||
:target: https://github.com/OCA/web/tree/13.0/web_group_expand
|
:target: https://github.com/OCA/web/tree/14.0/web_group_expand
|
||||||
:alt: OCA/web
|
:alt: OCA/web
|
||||||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
||||||
:target: https://translation.odoo-community.org/projects/web-13-0/web-13-0-web_group_expand
|
:target: https://translation.odoo-community.org/projects/web-13-0/web-13-0-web_group_expand
|
||||||
:alt: Translate me on Weblate
|
:alt: Translate me on Weblate
|
||||||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
|
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
|
||||||
:target: https://runbot.odoo-community.org/runbot/162/13.0
|
:target: https://runbot.odoo-community.org/runbot/162/14.0
|
||||||
:alt: Try me on Runbot
|
:alt: Try me on Runbot
|
||||||
|
|
||||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||||
|
@ -43,7 +43,7 @@ Bug Tracker
|
||||||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
|
Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
|
||||||
In case of trouble, please check there if your issue has already been reported.
|
In case of trouble, please check there if your issue has already been reported.
|
||||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||||
`feedback <https://github.com/OCA/web/issues/new?body=module:%20web_group_expand%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
`feedback <https://github.com/OCA/web/issues/new?body=module:%20web_group_expand%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||||
|
|
||||||
Do not contact contributors directly about support or help with technical issues.
|
Do not contact contributors directly about support or help with technical issues.
|
||||||
|
|
||||||
|
@ -82,6 +82,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
|
||||||
mission is to support the collaborative development of Odoo features and
|
mission is to support the collaborative development of Odoo features and
|
||||||
promote its widespread use.
|
promote its widespread use.
|
||||||
|
|
||||||
This module is part of the `OCA/web <https://github.com/OCA/web/tree/13.0/web_group_expand>`_ project on GitHub.
|
This module is part of the `OCA/web <https://github.com/OCA/web/tree/14.0/web_group_expand>`_ project on GitHub.
|
||||||
|
|
||||||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "Group Expand Buttons",
|
"name": "Group Expand Buttons",
|
||||||
"category": "Web",
|
"category": "Web",
|
||||||
"version": "13.0.1.0.0",
|
"version": "14.0.1.0.0",
|
||||||
"license": "AGPL-3",
|
"license": "AGPL-3",
|
||||||
"author": "OpenERP SA, "
|
"author": "OpenERP SA, "
|
||||||
"AvanzOSC, "
|
"AvanzOSC, "
|
||||||
|
@ -9,6 +9,7 @@
|
||||||
"Therp BV, "
|
"Therp BV, "
|
||||||
"Xtendoo, "
|
"Xtendoo, "
|
||||||
"Odoo Community Association (OCA)",
|
"Odoo Community Association (OCA)",
|
||||||
|
"website": "https://github.com/OCA/web",
|
||||||
"depends": ["web"],
|
"depends": ["web"],
|
||||||
"qweb": ["static/src/xml/expand_buttons.xml"],
|
"qweb": ["static/src/xml/expand_buttons.xml"],
|
||||||
"data": ["views/templates.xml"],
|
"data": ["views/templates.xml"],
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#
|
#
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Odoo Server 12.0\n"
|
"Project-Id-Version: Odoo Server 14.0\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"PO-Revision-Date: 2021-02-17 10:45+0000\n"
|
"PO-Revision-Date: 2021-02-17 10:45+0000\n"
|
||||||
"Last-Translator: claudiagn <claudia.gargallo@qubiq.es>\n"
|
"Last-Translator: claudiagn <claudia.gargallo@qubiq.es>\n"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#
|
#
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Odoo Server 12.0\n"
|
"Project-Id-Version: Odoo Server 14.0\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"PO-Revision-Date: 2020-09-16 14:00+0000\n"
|
"PO-Revision-Date: 2020-09-16 14:00+0000\n"
|
||||||
"Last-Translator: claudiagn <claudia.gargallo@qubiq.es>\n"
|
"Last-Translator: claudiagn <claudia.gargallo@qubiq.es>\n"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#
|
#
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Odoo Server 12.0\n"
|
"Project-Id-Version: Odoo Server 14.0\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2020-04-20 10:58+0000\n"
|
"POT-Creation-Date: 2020-04-20 10:58+0000\n"
|
||||||
"PO-Revision-Date: 2020-04-20 12:59+0200\n"
|
"PO-Revision-Date: 2020-04-20 12:59+0200\n"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#
|
#
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Odoo Server 12.0\n"
|
"Project-Id-Version: Odoo Server 14.0\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"PO-Revision-Date: 2021-03-15 06:45+0000\n"
|
"PO-Revision-Date: 2021-03-15 06:45+0000\n"
|
||||||
"Last-Translator: Marcel Savegnago <marcel.savegnago@gmail.com>\n"
|
"Last-Translator: Marcel Savegnago <marcel.savegnago@gmail.com>\n"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#
|
#
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Odoo Server 13.0\n"
|
"Project-Id-Version: Odoo Server 14.0\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"Last-Translator: \n"
|
"Last-Translator: \n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
|
|
|
@ -4,3 +4,4 @@
|
||||||
* Jay Vora (SerpentCS) for their alternative implementation
|
* Jay Vora (SerpentCS) for their alternative implementation
|
||||||
* Jan Verbeek <jverbeek@therp.nl>
|
* Jan Verbeek <jverbeek@therp.nl>
|
||||||
* Manuel Calero <manuelcalerosolis@gmail.com>
|
* Manuel Calero <manuelcalerosolis@gmail.com>
|
||||||
|
* Alvaro Estebanez (brain-tec AG) <alvaro.estebanez@bt-group.com>
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
odoo.define("web.web_group_expand", function(require) {
|
odoo.define("web.web_group_expand", function (require) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var qweb = require("web.core").qweb;
|
var qweb = require("web.core").qweb;
|
||||||
|
|
||||||
require("web.ListController").include({
|
require("web.ListController").include({
|
||||||
start: function() {
|
start: function () {
|
||||||
this.$expandGroupButtons = $(qweb.render("web_group_expand.Buttons"));
|
this.$expandGroupButtons = $(qweb.render("web_group_expand.Buttons"));
|
||||||
this.$expandGroupButtons
|
this.$expandGroupButtons
|
||||||
.find("#oe_group_by_expand")
|
.find("#oe_group_by_expand")
|
||||||
|
@ -15,18 +15,18 @@ odoo.define("web.web_group_expand", function(require) {
|
||||||
return this._super.apply(this, arguments);
|
return this._super.apply(this, arguments);
|
||||||
},
|
},
|
||||||
|
|
||||||
renderPager: function($node) {
|
renderButtons: function () {
|
||||||
this._super.apply(this, arguments);
|
this._super.apply(this, arguments);
|
||||||
this.$expandGroupButtons.toggleClass("o_hidden", !this.renderer.isGrouped);
|
this.$expandGroupButtons.toggleClass("o_hidden", !this.renderer.isGrouped);
|
||||||
$node.append(this.$expandGroupButtons);
|
this.$buttons.append(this.$expandGroupButtons);
|
||||||
},
|
},
|
||||||
|
|
||||||
expandAllGroups: function() {
|
expandAllGroups: function () {
|
||||||
// We expand layer by layer. So first we need to find the highest
|
// We expand layer by layer. So first we need to find the highest
|
||||||
// layer that's not already fully expanded.
|
// layer that's not already fully expanded.
|
||||||
var layer = this.renderer.state.data;
|
var layer = this.renderer.state.data;
|
||||||
while (layer.length) {
|
while (layer.length) {
|
||||||
var closed = layer.filter(function(group) {
|
var closed = layer.filter(function (group) {
|
||||||
return !group.isOpen;
|
return !group.isOpen;
|
||||||
});
|
});
|
||||||
if (closed.length) {
|
if (closed.length) {
|
||||||
|
@ -36,7 +36,7 @@ odoo.define("web.web_group_expand", function(require) {
|
||||||
}
|
}
|
||||||
// This layer is completely expanded, move to the next
|
// This layer is completely expanded, move to the next
|
||||||
layer = _.flatten(
|
layer = _.flatten(
|
||||||
layer.map(function(group) {
|
layer.map(function (group) {
|
||||||
return group.data;
|
return group.data;
|
||||||
}),
|
}),
|
||||||
true
|
true
|
||||||
|
@ -44,19 +44,19 @@ odoo.define("web.web_group_expand", function(require) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
collapseAllGroups: function() {
|
collapseAllGroups: function () {
|
||||||
// We collapse layer by layer. So first we need to find the deepest
|
// We collapse layer by layer. So first we need to find the deepest
|
||||||
// layer that's not already fully collapsed.
|
// layer that's not already fully collapsed.
|
||||||
var layer = this.renderer.state.data.filter(function(group) {
|
var layer = this.renderer.state.data.filter(function (group) {
|
||||||
return group.isOpen;
|
return group.isOpen;
|
||||||
});
|
});
|
||||||
while (layer.length) {
|
while (layer.length) {
|
||||||
var next = _.flatten(
|
var next = _.flatten(
|
||||||
layer.map(function(group) {
|
layer.map(function (group) {
|
||||||
return group.data;
|
return group.data;
|
||||||
}),
|
}),
|
||||||
true
|
true
|
||||||
).filter(function(group) {
|
).filter(function (group) {
|
||||||
return group.isOpen;
|
return group.isOpen;
|
||||||
});
|
});
|
||||||
if (!next.length) {
|
if (!next.length) {
|
||||||
|
@ -68,9 +68,9 @@ odoo.define("web.web_group_expand", function(require) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_toggleGroups: function(groups) {
|
_toggleGroups: function (groups) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var defs = groups.map(function(group) {
|
var defs = groups.map(function (group) {
|
||||||
return self.model.toggleGroup(group.id);
|
return self.model.toggleGroup(group.id);
|
||||||
});
|
});
|
||||||
$.when(...defs).then(
|
$.when(...defs).then(
|
||||||
|
@ -80,7 +80,7 @@ odoo.define("web.web_group_expand", function(require) {
|
||||||
});
|
});
|
||||||
|
|
||||||
require("web.ListRenderer").include({
|
require("web.ListRenderer").include({
|
||||||
updateState: function() {
|
updateState: function () {
|
||||||
var res = this._super.apply(this, arguments);
|
var res = this._super.apply(this, arguments);
|
||||||
$("nav.oe_group_by_expand_buttons").toggleClass(
|
$("nav.oe_group_by_expand_buttons").toggleClass(
|
||||||
"o_hidden",
|
"o_hidden",
|
||||||
|
|
Loading…
Reference in New Issue