diff --git a/account_tax_report_no_zeroes/README.rst b/account_tax_report_no_zeroes/README.rst new file mode 100644 index 00000000..3247b4da --- /dev/null +++ b/account_tax_report_no_zeroes/README.rst @@ -0,0 +1,58 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +================================= +Account tax report without zeroes +================================= + +Remove lines with a zero tax amount in the generic taxes report. + +Usage +===== + +Print the tax report as usual in Accounting > Reporting > Taxes > Taxes Report, +but with this module, only lines with amounts will be printed. + + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/91/8.0 + + +Known issues / Roadmap +====================== + +* Let the user to decide if they want the zeroes in the report or not. For now, + zeroes are always hidden. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +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 feedback +`here `_. + +Credits +======= + +Contributors +------------ + +* Pedro M. Baeza + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://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/account_tax_report_no_zeroes/__init__.py b/account_tax_report_no_zeroes/__init__.py new file mode 100644 index 00000000..ac0757eb --- /dev/null +++ b/account_tax_report_no_zeroes/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# (c) 2015 Pedro M. Baeza +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from . import report diff --git a/account_tax_report_no_zeroes/__openerp__.py b/account_tax_report_no_zeroes/__openerp__.py new file mode 100644 index 00000000..b069b708 --- /dev/null +++ b/account_tax_report_no_zeroes/__openerp__.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# (c) 2015 Pedro M. Baeza +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +{ + 'name': 'Account tax report without zeroes', + 'version': '1.0', + 'category': 'Accounting & Finance', + 'author': 'Serv. Tecnol. Avanzados - Pedro M. Baeza,' + 'Odoo Community Association (OCA)', + 'website': 'http://www.serviciosbaeza.com', + 'depends': [ + 'account', + ], + 'installable': True, +} diff --git a/account_tax_report_no_zeroes/report/__init__.py b/account_tax_report_no_zeroes/report/__init__.py new file mode 100644 index 00000000..9bc6d8a0 --- /dev/null +++ b/account_tax_report_no_zeroes/report/__init__.py @@ -0,0 +1,5 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## +from . import report_vat diff --git a/account_tax_report_no_zeroes/report/report_vat.py b/account_tax_report_no_zeroes/report/report_vat.py new file mode 100644 index 00000000..42bf732e --- /dev/null +++ b/account_tax_report_no_zeroes/report/report_vat.py @@ -0,0 +1,27 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## +from openerp import models +from openerp.addons.account.report.report_vat import tax_report +from functools import partial + + +class TaxReport(tax_report): + def __init__(self, cr, uid, name, context=None): + super(TaxReport, self).__init__(cr, uid, name, context=context) + self.localcontext.update({ + 'get_lines': partial(self._get_lines, context=context), + }) + + def _get_lines(self, based_on, company_id=False, parent=False, level=0, + context=None): + result = super(TaxReport, self)._get_lines( + based_on, company_id=company_id, parent=parent, level=level, + context=context) + return filter(lambda x: x['tax_amount'], result) + + +class ReportVat(models.AbstractModel): + _inherit = 'report.account.report_vat' + _wrapped_report_class = TaxReport diff --git a/account_tax_report_no_zeroes/static/description/icon.png b/account_tax_report_no_zeroes/static/description/icon.png new file mode 100644 index 00000000..3a0328b5 Binary files /dev/null and b/account_tax_report_no_zeroes/static/description/icon.png differ