Skip to content

Commit

Permalink
Merge pull request #11 from nbessi/fix_pep8_70
Browse files Browse the repository at this point in the history
Fix flake8 error for all addons
  • Loading branch information
bwrsandman committed Jul 11, 2014
2 parents cc07ad5 + 7f1c747 commit 0270e94
Show file tree
Hide file tree
Showing 72 changed files with 1,462 additions and 1,054 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ virtualenv:
system_site_packages: true

before_install:
- git clone https://github.com/nbessi/maintainer-quality-tools.git $HOME/maintainer-quality-tools
- git clone https://github.com/nbessi/maintainer-quality-tools.git $HOME/maintainer-quality-tools -b consolidated
- git clone https://github.com/OCA/connector $HOME/connector -b 7.0

env:
Expand All @@ -20,7 +20,7 @@ install:
- pip install coveralls flake8

script:
#- travis_run_flake8 # will be done in a separated commit
- travis_run_flake8 steps
- travis_run_tests_encapsulated 7.0 account $HOME/connector

after_success:
Expand Down
2 changes: 0 additions & 2 deletions account_cancel_invoice_check_payment_order/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,3 @@
#
##############################################################################
from . import account_invoice
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

15 changes: 7 additions & 8 deletions account_cancel_invoice_check_payment_order/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,18 @@
#
##############################################################################
{
"name" : "Cancel invoice, check on payment order",
"version" : "1.0",
"depends" : ["account",
"account_payment",
"account_cancel"
],
"author" : "Camptocamp",
"name": "Cancel invoice, check on payment order",
"version": "1.0",
"depends": ["account",
"account_payment",
"account_cancel"],
"author": "Camptocamp",
"description": """
Prevents to cancel an invoice which has already been imported in a
payment order.
""",
'website': 'http://www.camptocamp.com',
'data' : [],
'data': [],
'installable': True,
'active': False,
}
Expand Down
15 changes: 8 additions & 7 deletions account_cancel_invoice_check_payment_order/account_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ def action_cancel(self, cr, uid, ids, *args):
payment_orders = cr.dictfetchone()
if payment_orders:
raise osv.except_osv(
_('Error !'),
_("Invoice already imported in the payment "
"order (%s) at %s on line %s" %
(payment_orders['payment_name'],
payment_orders['payment_date'],
payment_orders['name'])))
return super(account_invoice,self).action_cancel(cr, uid, ids, *args)
_('Error !'),
_("Invoice already imported in the payment "
"order (%s) at %s on line %s" %
(payment_orders['payment_name'],
payment_orders['payment_date'],
payment_orders['name']))
)
return super(account_invoice, self).action_cancel(cr, uid, ids, *args)
2 changes: 0 additions & 2 deletions account_cancel_invoice_check_voucher/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,3 @@
##############################################################################

from . import account_invoice
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

21 changes: 11 additions & 10 deletions account_cancel_invoice_check_voucher/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
30 changes: 16 additions & 14 deletions account_cancel_invoice_check_voucher/account_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,34 @@
from openerp.tools.translate import _
from openerp.osv import osv, orm


class account_invoice(orm.Model):
_inherit = "account.invoice"

def action_cancel(self, cr, uid, ids, context=None):
invoices = self.read(cr, uid, ids, ['move_id', 'payment_ids'])
for invoice in invoices:
if invoice['move_id']:
## This invoice have a move line, we search move_line concerned by this move
# This invoice have a move line, we search move_line concerned by this move
cr.execute("""SELECT abs.name AS statement_name,
abs.date AS statement_date,
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)

0 comments on commit 0270e94

Please sign in to comment.