From 61ed80a0f8d61e247602c76298efa504dbdd5835 Mon Sep 17 00:00:00 2001 From: "Rifakat Haradwala (Open ERP)" Date: Mon, 16 May 2011 16:13:53 +0530 Subject: [PATCH] [FIX]: account_payment: passed date argument in onchange_partner_id() and cheking on move_line_id bzr revid: rha@tinyerp.com-20110516104353-r7drgvqd75jifhcb --- .../wizard/account_payment_populate_statement.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/account_payment/wizard/account_payment_populate_statement.py b/addons/account_payment/wizard/account_payment_populate_statement.py index 340ab4bcb03..f45d9838d7c 100644 --- a/addons/account_payment/wizard/account_payment_populate_statement.py +++ b/addons/account_payment/wizard/account_payment_populate_statement.py @@ -75,8 +75,10 @@ class account_payment_populate_statement(osv.osv_memory): amount = currency_obj.compute(cr, uid, line.currency.id, statement.currency.id, line.amount_currency, context=ctx) - context.update({'move_line_ids': [line.move_line_id.id]}) - result = voucher_obj.onchange_partner_id(cr, uid, [], partner_id=line.partner_id.id, journal_id=statement.journal_id.id, price=abs(amount), currency_id= statement.currency.id, ttype='payment', context=context) + if line.move_line_id.id: + context.update({'move_line_ids': [line.move_line_id.id]}) + + result = voucher_obj.onchange_partner_id(cr, uid, [], partner_id=line.partner_id.id, journal_id=statement.journal_id.id, price=abs(amount), currency_id= statement.currency.id, ttype='payment', date=line.date, context=context) if line.move_line_id: voucher_res = {