diff --git a/addons/account_payment/wizard/wizard_payment_order.py b/addons/account_payment/wizard/wizard_payment_order.py index 1e65308817c..a9a7dea3335 100644 --- a/addons/account_payment/wizard/wizard_payment_order.py +++ b/addons/account_payment/wizard/wizard_payment_order.py @@ -40,8 +40,15 @@ FIELDS = { def search_entries(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) + order_obj = pool.get('payment.order') line_obj = pool.get('account.move.line') + payment = order_obj.browse(cr, uid, data['id'], + context=context) + ctx = '' + if payment.mode: + ctx = '''context="{'journal_id': %d}"''' % payment.mode.journal.id + # Search for move line to pay: line_ids = line_obj.search(cr, uid, [ ('reconcile_id', '=', False), @@ -50,8 +57,8 @@ def search_entries(self, cr, uid, data, context): FORM.string = '''
-''' % (','.join([str(x) for x in line_ids])) + domain="[('id', 'in', [%s])]" %s/> +''' % (','.join([str(x) for x in line_ids]), ctx) return {} def create_payment(self, cr, uid, data, context):