diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 6c6f2865ceb..4be8967320f 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() @@ -495,7 +498,6 @@ class account_voucher(osv.osv): 'date_original':line.date, 'date_due':line.date_maturity, 'amount_unreconciled': amount_unreconciled, - } if line.credit: diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml index 7672e34a6af..dcbd035ac4f 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)"/>