From f2b070828e1d291dd21e5e24b470be25e0604c4d Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Mon, 1 Jun 2015 12:15:40 +0200 Subject: [PATCH] [ADD] web_dashboard_open_action --- web_dashboard_open_action/README.rst | 30 ++++++++++++ web_dashboard_open_action/__init__.py | 20 ++++++++ web_dashboard_open_action/__openerp__.py | 45 ++++++++++++++++++ .../static/description/icon.png | Bin 0 -> 6907 bytes .../src/css/web_dashboard_open_action.css | 4 ++ .../src/js/web_dashboard_open_action.js | 38 +++++++++++++++ .../src/xml/web_dashboard_open_action.xml | 7 +++ web_dashboard_open_action/views/templates.xml | 11 +++++ 8 files changed, 155 insertions(+) create mode 100644 web_dashboard_open_action/README.rst create mode 100644 web_dashboard_open_action/__init__.py create mode 100644 web_dashboard_open_action/__openerp__.py create mode 100644 web_dashboard_open_action/static/description/icon.png create mode 100644 web_dashboard_open_action/static/src/css/web_dashboard_open_action.css create mode 100644 web_dashboard_open_action/static/src/js/web_dashboard_open_action.js create mode 100644 web_dashboard_open_action/static/src/xml/web_dashboard_open_action.xml create mode 100644 web_dashboard_open_action/views/templates.xml diff --git a/web_dashboard_open_action/README.rst b/web_dashboard_open_action/README.rst new file mode 100644 index 00000000..55d842e9 --- /dev/null +++ b/web_dashboard_open_action/README.rst @@ -0,0 +1,30 @@ +Open a dashboard's action +========================= + +This module adds a button to open a dashboard's action in the usual view, thus enabling filtering and any other actions you can apply on the resulting records. Basically, this is the inverso to `Add to dashboard`. + +Usage +===== + +After installation, a dashboard has a `Maximize`-button that loads the dashboard's action in a normal view. + +Credits +======= + +Contributors +------------ + +* Holger Brunn + +Maintainer +---------- + +.. image:: http://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: http://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. + +To contribute to this module, please visit http://odoo-community.org. diff --git a/web_dashboard_open_action/__init__.py b/web_dashboard_open_action/__init__.py new file mode 100644 index 00000000..faef9dac --- /dev/null +++ b/web_dashboard_open_action/__init__.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# This module copyright (C) 2015 Therp BV . +# +# 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_dashboard_open_action/__openerp__.py b/web_dashboard_open_action/__openerp__.py new file mode 100644 index 00000000..da455c34 --- /dev/null +++ b/web_dashboard_open_action/__openerp__.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# This module copyright (C) 2015 Therp BV . +# +# 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": "Open a dashboard's action", + "version": "1.0", + "author": "Therp BV", + "license": "AGPL-3", + "category": "Hidden", + "summary": "Adds a button to open a dashboard in full mode", + "depends": [ + 'board', + ], + "data": [ + 'views/templates.xml', + ], + "qweb": [ + 'static/src/xml/web_dashboard_open_action.xml', + ], + "test": [ + ], + "auto_install": False, + "installable": True, + "application": False, + "external_dependencies": { + 'python': [], + }, +} diff --git a/web_dashboard_open_action/static/description/icon.png b/web_dashboard_open_action/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..1a22a285ca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ohU~9kLqnR(ydI-$#K33Cv@UM^Y3Q8}QR|>Vh|){=YdL;fEE9m-KL= X(w!Fx-Uru-DuB-2`. +// +// 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 . +// +//############################################################################ + +openerp.web_dashboard_open_action = function(instance) +{ + instance.web.form.DashBoard.include({ + on_load_action: function(result, index, action_attrs) + { + var self = this, action = _.extend({flags: {}}, result); + jQuery('#' + this.view.element_id + '_action_' + index) + .parent() + .find('.oe_web_dashboard_open_action') + .click(function() + { + self.do_action(action); + }); + return this._super.apply(this, arguments); + }, + }); +} diff --git a/web_dashboard_open_action/static/src/xml/web_dashboard_open_action.xml b/web_dashboard_open_action/static/src/xml/web_dashboard_open_action.xml new file mode 100644 index 00000000..f124a140 --- /dev/null +++ b/web_dashboard_open_action/static/src/xml/web_dashboard_open_action.xml @@ -0,0 +1,7 @@ + + + + &square; + + + diff --git a/web_dashboard_open_action/views/templates.xml b/web_dashboard_open_action/views/templates.xml new file mode 100644 index 00000000..625bf50a --- /dev/null +++ b/web_dashboard_open_action/views/templates.xml @@ -0,0 +1,11 @@ + + + + + +