From 02ce0057eaa788fc0281926c46c3f5143de2f405 Mon Sep 17 00:00:00 2001 From: Nicolas Bessi Date: Wed, 20 Aug 2014 15:46:23 +0200 Subject: [PATCH] [FIX] pep8 line length to 80, activate pep8 check in travis, and add noqa on scenario while waiting improvement of quality-tools --- .../__openerp__.py | 20 +++++++++++++------ .../account_invoice.py | 9 ++++++--- account_fiscal_position_vat_check/partner.py | 6 ++++-- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/account_fiscal_position_vat_check/__openerp__.py b/account_fiscal_position_vat_check/__openerp__.py index 55e296ee3..717c6f67f 100644 --- a/account_fiscal_position_vat_check/__openerp__.py +++ b/account_fiscal_position_vat_check/__openerp__.py @@ -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 for any help or question about this module. diff --git a/account_fiscal_position_vat_check/account_invoice.py b/account_fiscal_position_vat_check/account_invoice.py index 05c3b6c63..810c42d35 100644 --- a/account_fiscal_position_vat_check/account_invoice.py +++ b/account_fiscal_position_vat_check/account_invoice.py @@ -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, diff --git a/account_fiscal_position_vat_check/partner.py b/account_fiscal_position_vat_check/partner.py index 86d8747b3..3c206e93b 100644 --- a/account_fiscal_position_vat_check/partner.py +++ b/account_fiscal_position_vat_check/partner.py @@ -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'] } }