From 5662edef866e3408ee1d52bab0a4c6854e25dbe4 Mon Sep 17 00:00:00 2001 From: Nicolas Bessi Date: Thu, 10 Jul 2014 15:31:52 +0200 Subject: [PATCH] [FIX] flake8 PEP8 for module account_cancel_check_voucher --- .../__init__.py | 2 -- .../__openerp__.py | 21 +++++++------- .../account_invoice.py | 28 ++++++++++--------- 3 files changed, 26 insertions(+), 25 deletions(-) diff --git a/account_cancel_invoice_check_voucher/__init__.py b/account_cancel_invoice_check_voucher/__init__.py index 7be6ed351..580b686f6 100644 --- a/account_cancel_invoice_check_voucher/__init__.py +++ b/account_cancel_invoice_check_voucher/__init__.py @@ -19,5 +19,3 @@ ############################################################################## from . import account_invoice -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/account_cancel_invoice_check_voucher/__openerp__.py b/account_cancel_invoice_check_voucher/__openerp__.py index 75329fbaf..9bc1e16f3 100644 --- a/account_cancel_invoice_check_voucher/__openerp__.py +++ b/account_cancel_invoice_check_voucher/__openerp__.py @@ -18,18 +18,19 @@ # ############################################################################## { - "name" : "Cancel invoice, check on bank statement", - "version" : "1.0", - "depends" : ["base", - "account", - "account_voucher", - "account_cancel", - ], - "author" : "Camptocamp", - "description": """Constraint forbidding to cancel an invoice already imported in bank statement with a voucher. + "name": "Cancel invoice, check on bank statement", + "version": "1.0", + "depends": ["base", + "account", + "account_voucher", + "account_cancel"], + "author": "Camptocamp", + "description": """ +Constraint forbidding to cancel an invoice already +imported in bank statement with a voucher. """, 'website': 'http://www.camptocamp.com', - 'date' : [], + 'date': [], 'installable': True, 'active': False, } diff --git a/account_cancel_invoice_check_voucher/account_invoice.py b/account_cancel_invoice_check_voucher/account_invoice.py index d2929a190..a3c018cf9 100644 --- a/account_cancel_invoice_check_voucher/account_invoice.py +++ b/account_cancel_invoice_check_voucher/account_invoice.py @@ -24,6 +24,7 @@ from openerp.tools.translate import _ from openerp.osv import osv, orm + class account_invoice(orm.Model): _inherit = "account.invoice" @@ -37,19 +38,20 @@ class account_invoice(orm.Model): absl.name FROM account_bank_statement_line AS absl INNER JOIN account_bank_statement AS abs - ON absl.statement_id = abs.id - WHERE EXISTS (SELECT 1 - FROM account_voucher_line JOIN account_move_line ON - (account_voucher_line.move_line_id = account_move_line.id) - WHERE voucher_id=absl.voucher_id - AND account_move_line.move_id = %s )""", - (invoice['move_id'][0],)) + ON absl.statement_id = abs.id + WHERE EXISTS (SELECT 1 + FROM account_voucher_line JOIN account_move_line ON + (account_voucher_line.move_line_id = account_move_line.id) + WHERE voucher_id=absl.voucher_id + AND account_move_line.move_id = %s )""", + (invoice['move_id'][0],)) statement_lines = cr.dictfetchone() if statement_lines: - raise osv.except_osv(_('Error!'), - _('Invoice already imported in bank statment (%s) at %s on line %s' - % (statement_lines['statement_name'], - statement_lines['statement_date'], - statement_lines['name'],))) + raise osv.except_osv( + _('Error!'), + _('Invoice already imported in bank statment (%s) at %s on line %s' + % (statement_lines['statement_name'], + statement_lines['statement_date'], + statement_lines['name'],))) - return super(account_invoice,self).action_cancel(cr, uid, ids, context=context) + return super(account_invoice, self).action_cancel(cr, uid, ids, context=context)