From 0c9e4c8e657f7d23b261c30de098a80171b561d0 Mon Sep 17 00:00:00 2001 From: Sandy Carter Date: Thu, 21 Aug 2014 11:25:17 -0400 Subject: [PATCH] PEP8 on account_payment_shortcut --- account_payment_shortcut/__openerp__.py | 7 ++++--- account_payment_shortcut/payment_order.py | 15 +++++++++------ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/account_payment_shortcut/__openerp__.py b/account_payment_shortcut/__openerp__.py index 30e3acc72..dcceaab45 100644 --- a/account_payment_shortcut/__openerp__.py +++ b/account_payment_shortcut/__openerp__.py @@ -5,8 +5,8 @@ # All Rights Reserved # # This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, @@ -27,7 +27,8 @@ 'category': 'Banking addons', 'depends': ['account_payment'], 'description': ''' -When composing a payment order, select all candidates by default (in the second step of the "Select invoices to pay" wizard). +When composing a payment order, select all candidates by default +(in the second step of the "Select invoices to pay" wizard). ''', 'installable': True, } diff --git a/account_payment_shortcut/payment_order.py b/account_payment_shortcut/payment_order.py index 93dfb125b..b44c6b8da 100644 --- a/account_payment_shortcut/payment_order.py +++ b/account_payment_shortcut/payment_order.py @@ -2,7 +2,7 @@ ############################################################################## # # Copyright (C) 2011 - 2013 Therp BV (). -# +# # All other contributions are (C) by their respective contributors # # All Rights Reserved @@ -24,11 +24,12 @@ from openerp.osv import orm + class payment_order_create(orm.TransientModel): _inherit = 'payment.order.create' def default_get(self, cr, uid, fields_list, context=None): - """ + """ Automatically add the candidate move lines to the payment order, instead of only applying them to the domain. @@ -39,13 +40,15 @@ class payment_order_create(orm.TransientModel): been placed in the context at object creation time. """ + if context is None: + context = {} res = super(payment_order_create, self).default_get( cr, uid, fields_list, context=context) - if (fields_list and 'entries' in fields_list - and 'entries' not in res - and context and context.get('line_ids', False) - ): + if (fields_list + and 'entries' in fields_list + and 'entries' not in res + and context.get('line_ids', False)): res['entries'] = context['line_ids'] return res