Browse Source

[ADD] web_dashboard_open_action

pull/140/head
Holger Brunn 9 years ago
parent
commit
f2b070828e
  1. 30
      web_dashboard_open_action/README.rst
  2. 20
      web_dashboard_open_action/__init__.py
  3. 45
      web_dashboard_open_action/__openerp__.py
  4. BIN
      web_dashboard_open_action/static/description/icon.png
  5. 4
      web_dashboard_open_action/static/src/css/web_dashboard_open_action.css
  6. 38
      web_dashboard_open_action/static/src/js/web_dashboard_open_action.js
  7. 7
      web_dashboard_open_action/static/src/xml/web_dashboard_open_action.xml
  8. 11
      web_dashboard_open_action/views/templates.xml

30
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 <hbrunn@therp.nl>
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.

20
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 <http://therp.nl>.
#
# 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/>.
#
##############################################################################

45
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 <http://therp.nl>.
#
# 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/>.
#
##############################################################################
{
"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': [],
},
}

BIN
web_dashboard_open_action/static/description/icon.png

After

Width: 128  |  Height: 128  |  Size: 6.7 KiB

4
web_dashboard_open_action/static/src/css/web_dashboard_open_action.css

@ -0,0 +1,4 @@
.openerp .oe_dashboard .oe_action span.oe_web_dashboard_open_action
{
margin-right: .2em;
}

38
web_dashboard_open_action/static/src/js/web_dashboard_open_action.js

@ -0,0 +1,38 @@
//-*- coding: utf-8 -*-
//############################################################################
//
// OpenERP, Open Source Management Solution
// This module copyright (C) 2015 Therp BV <http://therp.nl>.
//
// 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/>.
//
//############################################################################
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);
},
});
}

7
web_dashboard_open_action/static/src/xml/web_dashboard_open_action.xml

@ -0,0 +1,7 @@
<templates>
<t t-extend="DashBoard.action">
<t t-jquery="span.oe_minimize" t-operation="after">
<span class="oe_icon oe_web_dashboard_open_action">&amp;square;</span>
</t>
</t>
</templates>

11
web_dashboard_open_action/views/templates.xml

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<template id="assets_backend" name="web_dashboard_open_action assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/web_dashboard_open_action/static/src/js/web_dashboard_open_action.js"></script>
<link rel="stylesheet" href="/web_dashboard_open_action/static/src/css/web_dashboard_open_action.css"/>
</xpath>
</template>
</data>
</openerp>
Loading…
Cancel
Save