[FIX] pep8 line length to 80, activate pep8 check in travis, and add noqa on scenario while waiting improvement of quality-tools

This commit is contained in:
Nicolas Bessi
2014-08-20 15:46:23 +02:00
committed by Raf Ven
parent a9a280d941
commit 02ce0057ea
3 changed files with 24 additions and 11 deletions

View File

@@ -32,17 +32,25 @@ Check that the Customer has a VAT number on invoice validation
==============================================================
This module adds an option **Customer must have VAT** on fiscal positions.
When a user tries to validate a customer invoice or refund with a fiscal position
When a user tries to validate a customer invoice or refund
with a fiscal position
that have this option, OpenERP will check that the customer has a VAT number.
If it doesn't, OpenERP will block the validation of the invoice and display an error message.
If it doesn't, OpenERP will block the validation of the invoice
and display an error message.
In the European Union (EU), when an EU company sends an invoice to another EU company in another country,
In the European Union (EU), when an EU company sends an invoice to
another EU company in another country,
it can invoice without VAT (most of the time) but the VAT number of the customer must be displayed on the invoice.
it can invoice without VAT (most of the time) but the VAT number of the
customer must be displayed on the invoice.
This module also displays a warning when a user sets a fiscal position with the option
**Customer must have VAT** on a customer and this customer doesn't have a VAT number in OpenERP yet.
This module also displays a warning when a user sets
a fiscal position with the option
**Customer must have VAT**
on a customer and this customer doesn't have a VAT number in OpenERP yet.
Please contact Alexis de Lattre from Akretion <alexis.delattre@akretion.com>
for any help or question about this module.

View File

@@ -30,7 +30,8 @@ class account_fiscal_position(orm.Model):
_columns = {
'customer_must_have_vat': fields.boolean(
'Customer Must Have VAT number',
help="If enabled, OpenERP will check that the customer has a VAT number "
help="If enabled, OpenERP will check "
"that the customer has a VAT number "
"when the user validates a customer invoice/refund."
),
}
@@ -53,9 +54,11 @@ class account_invoice(orm.Model):
type_label = _('a Customer Refund')
raise orm.except_orm(
_('Missing VAT number:'),
_("You are trying to validate %s with the fiscal position '%s' "
_("You are trying to validate %s "
"with the fiscal position '%s' "
"that require the customer to have a VAT number. "
"But the Customer '%s' doesn't have a VAT number in OpenERP."
"But the Customer '%s' doesn't "
"have a VAT number in OpenERP."
"Please add the VAT number of this Customer in OpenERP "
" and try to validate again.")
% (type_label, invoice.fiscal_position.name,

View File

@@ -27,7 +27,8 @@ from openerp.tools.translate import _
class res_partner(orm.Model):
_inherit = 'res.partner'
def fiscal_position_change(self, cr, uid, ids, account_position, vat, customer):
def fiscal_position_change(self, cr, uid, ids, account_position,
vat, customer):
'''Warning is the fiscal position requires a vat number and the partner
doesn't have one yet'''
if account_position and customer and not vat:
@@ -40,7 +41,8 @@ class res_partner(orm.Model):
'message': _(
"You have set the fiscal position '%s' "
"that require the customer to have a VAT number. "
"You should add the VAT number of this customer in OpenERP."
"You should add the VAT number of this customer"
" in OpenERP."
) % fp['name']
}
}