diff --git a/aeroo_report_to_printer/__init__.py b/aeroo_report_to_printer/__init__.py new file mode 100644 index 0000000..5bc8019 --- /dev/null +++ b/aeroo_report_to_printer/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import printing diff --git a/aeroo_report_to_printer/__openerp__.py b/aeroo_report_to_printer/__openerp__.py new file mode 100644 index 0000000..2e505f4 --- /dev/null +++ b/aeroo_report_to_printer/__openerp__.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Aeroo Report to Printer module for Odoo +# Copyright (C) 2015 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# +# 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': 'Aeroo Report to Printer', + 'version': '0.1', + 'category': 'Aeroo', + 'license': 'AGPL-3', + 'summary': 'Connect aeroo_report to base_report_to_printer', + 'description': """ +Aeroo Report to Printer +======================= + +There is a module *report_aeroo_direct_print* in https://github.com/aeroo/aeroo_reports that adds support for CUPS printing, but it's not as mature and clean as the OCA module *base_report_to_printer* from https://github.com/OCA/report-print-send. + +And I want to use the best of both world : the best reporting engine (Aeroo) with the best CUPS printing module (base_report_to_printer). So I developped this small glue module. + +You will find some sample code to use this module in the comments of the main Python file. + +This module has been written by Alexis de Lattre from Akretion . + """, + 'author': 'Akretion', + 'website': 'http://www.akretion.com', + 'depends': [ + 'base_report_to_printer', + 'report_aeroo', + 'base_other_report_engines', + ], + 'installable': True, +} diff --git a/aeroo_report_to_printer/printing.py b/aeroo_report_to_printer/printing.py new file mode 100644 index 0000000..e955929 --- /dev/null +++ b/aeroo_report_to_printer/printing.py @@ -0,0 +1,70 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Aeroo Report to Printer module for Odoo +# Copyright (C) 2015 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# +# 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 . +# +############################################################################## + +from openerp import models, api, _ +from openerp.exceptions import Warning as UserError + + +class PrintingPrinter(models.Model): + _inherit = 'printing.printer' + + @api.multi + def aeroo_print_document(self, report_name, object_id, copies=1): + ''' + Send an aeroo report to CUPS server for printing + + Usage example : + + Add this button in an inherit of the view 'stock.view_picking_form': +