From daa6d25c29fa80c2b4b2a26fc189059a667d0721 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Mon, 10 Jun 2013 14:52:02 +0200 Subject: [PATCH] [ADD] addons to get a proper print of only the data shown in an OpenERP screen --- web_print_from_browser/__init__.py | 22 +++++++++ web_print_from_browser/__openerp__.py | 45 +++++++++++++++++++ .../static/src/css/web_print_from_browser.css | 30 +++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 web_print_from_browser/__init__.py create mode 100644 web_print_from_browser/__openerp__.py create mode 100644 web_print_from_browser/static/src/css/web_print_from_browser.css diff --git a/web_print_from_browser/__init__.py b/web_print_from_browser/__init__.py new file mode 100644 index 00000000..a97ee816 --- /dev/null +++ b/web_print_from_browser/__init__.py @@ -0,0 +1,22 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# This module copyright (C) 2013 Therp BV () +# All Rights Reserved +# +# 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_print_from_browser/__openerp__.py b/web_print_from_browser/__openerp__.py new file mode 100644 index 00000000..56810933 --- /dev/null +++ b/web_print_from_browser/__openerp__.py @@ -0,0 +1,45 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# This module copyright (C) 2013 Therp BV () +# All Rights Reserved +# +# 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': 'Hide OpenERP controls while printing', + 'version': '1.0', + 'description': """ This addons provides a stylesheet that removes the menu + and controls when printing an OpenERP screen through the browser's print + button.""", + 'author': 'Therp BV', + 'website': 'http://www.therp.nl', + "category": "Tools", + "depends": [ + 'web', + ], + 'css': [ + 'static/src/css/web_print_from_browser.css', + ], + 'data': [ + ], + 'js': [ + ], + 'installable': True, + 'active': False, + 'certificate': '', +} diff --git a/web_print_from_browser/static/src/css/web_print_from_browser.css b/web_print_from_browser/static/src/css/web_print_from_browser.css new file mode 100644 index 00000000..c13d0040 --- /dev/null +++ b/web_print_from_browser/static/src/css/web_print_from_browser.css @@ -0,0 +1,30 @@ +@media print +{ + .view-manager-main-sidebar, + .oe_view_manager_menu_tips, + .oe_vm_switch, + .oe_form_header, + .oe-list-pager, + .oe-listview-content thead tr:first-child, + .oe-listview-header-columns th:first-child, + .oe-listview-header-columns th:nth-child(2), + .oe-record-selector, + .oe-record-edit-link, + .oe-record-delete, + .oe_debug_view, + .oe_searchable_view, + .oe-process-view, + #oe_secondary_menu, + table.main_table > tbody > tr:first-child, + table.main_table > tbody > tr:last-child, + .view-manager-main-content > div[id$=search] + { + display: none; + } + * + { + height: auto !important; + width: auto !important; + overflow: show !important; + } +}