PEP8 on account_payment_shortcut

This commit is contained in:
Sandy Carter
2014-08-21 11:25:17 -04:00
parent 7296904e5e
commit 0c9e4c8e65
2 changed files with 13 additions and 9 deletions

View File

@@ -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,
}

View File

@@ -2,7 +2,7 @@
##############################################################################
#
# Copyright (C) 2011 - 2013 Therp BV (<http://therp.nl>).
#
#
# 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