From f67d3f284bac54cf1f3104f7ab67828b934cc1ed Mon Sep 17 00:00:00 2001 From: "Jagdish Panchal (Open ERP)" Date: Fri, 6 May 2011 18:42:15 +0530 Subject: [PATCH] [FIX] account_voucher : Respective Invoice only displayed when paying via voucher from invoice payment lp bug: https://launchpad.net/bugs/767058 fixed bzr revid: jap@tinyerp.com-20110506131215-7k08ldbo7ufbscob --- addons/account_voucher/account_voucher.py | 5 ++++- .../voucher_payment_receipt_view.xml | 18 +++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 6c6f2865ceb..b0fcc55755d 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -460,7 +460,10 @@ class account_voucher(osv.osv): account_type = 'receivable' if not context.get('move_line_ids', False): - ids = move_line_pool.search(cr, uid, [('state','=','valid'), ('account_id.type', '=', account_type), ('reconcile_id', '=', False), ('partner_id', '=', partner_id)], context=context) + domain = [('state','=','valid'), ('account_id.type', '=', account_type), ('reconcile_id', '=', False), ('partner_id', '=', partner_id)] + if context.get('invoice_id', False): + domain.append(('invoice', '=', context['invoice_id'])) + ids = move_line_pool.search(cr, uid, domain, context=context) else: ids = context['move_line_ids'] ids.reverse() diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml index e73354eb59a..853d8858944 100644 --- a/addons/account_voucher/voucher_payment_receipt_view.xml +++ b/addons/account_voucher/voucher_payment_receipt_view.xml @@ -88,12 +88,12 @@
- - + + @@ -151,12 +151,12 @@ - - + + @@ -288,14 +288,14 @@ - + + on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)"/>