[FIX] remove deprecated code + add contributor + issue tracking

This commit is contained in:
vrenaville
2015-06-16 16:22:47 +02:00
parent 44726b34d6
commit 31cbecf511
3 changed files with 15 additions and 8 deletions

View File

@@ -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.
To contribute to this module, please visit http://odoo-community.org.
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/{project_repo}/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 <https://github.com/OCA/{project_repo}/issues/new?body=module:%20{module_name}%0Aversion:%20{version}%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

View File

@@ -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",

View File

@@ -17,8 +17,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
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