diff --git a/account_invoice_tax_required/README.rst b/account_invoice_tax_required/README.rst index 6cc891cb8..11f3cdfff 100644 --- a/account_invoice_tax_required/README.rst +++ b/account_invoice_tax_required/README.rst @@ -1,4 +1,4 @@ -Account invoices with tax required in invoice line +Account invoice with tax required in invoice line ================================================== This module adds functional a check on invoice @@ -33,4 +33,12 @@ 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. \ No newline at end of file +To contribute to this module, please visit http://odoo-community.org. + +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 `_. diff --git a/account_invoice_tax_required/__openerp__.py b/account_invoice_tax_required/__openerp__.py index bccc62998..2a23a5cad 100644 --- a/account_invoice_tax_required/__openerp__.py +++ b/account_invoice_tax_required/__openerp__.py @@ -20,7 +20,7 @@ { 'name': "Tax required in invoice", 'version': "1.0", - 'author': "Vincent Renaville", + "author": "Camptocamp,Odoo Community Association (OCA)", 'website': "http://www.camptocamp.com", 'category': "Localisation / Accounting", 'license': "AGPL-3", diff --git a/account_invoice_tax_required/models/account_invoice.py b/account_invoice_tax_required/models/account_invoice.py index 9ffbd15d2..44b0f06ba 100644 --- a/account_invoice_tax_required/models/account_invoice.py +++ b/account_invoice_tax_required/models/account_invoice.py @@ -17,8 +17,8 @@ # along with this program. If not, see . # ############################################################################## -from openerp import models, api, _ -from openerp.exceptions import except_orm +from openerp import models, api, exceptions, _ + class AccountInvoice(models.Model): _inherit = "account.invoice" @@ -27,16 +27,15 @@ class AccountInvoice(models.Model): def test_invoice_line_tax(self): errors = [] error_template = _("Invoice have a line with product %s with no taxes") - # check whether all corresponding account move lines are reconciled for invoice in self: for invoice_line in invoice.invoice_line: - # if not invoice_line.invoice_line_tax_id: error_string = error_template % (invoice_line.name) errors.append(error_string) if errors: errors_full_string = ','.join(x for x in errors) - raise except_orm(_('No Taxes Defined!'), errors_full_string) + raise exceptions.Warning(_('No Taxes Defined!'), + errors_full_string) else: return True