Xavier ALT (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.1-opw-575437-xal into 
lp:openobject-addons/6.1.

Requested reviews:
  Olivier Dony (OpenERP) (odo-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-575437-xal/+merge/108356

Hi,

This fix a problem when using "Import from Payment line" wizard on "Bank 
statement" (available when "account_payment" module is installed).

Steps:
1. install module "account_payement" (will install account_voucher by 
dependency)
2. create a supplier invoice and open it
3. create a payment order (Accounting > Payments > Payment Orders) and import 
invoice from [2].
4. create a new "Bank Statement"
5. click on "Import from Payement line", choose the payment line from [3] and 
"Import" it.

Current: voucher create on step 5, have no line within.
Expected: voucher should have a exactly one line corresponding to the one 
choosen on the payment line.

Cheers,
Xavier
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-575437-xal/+merge/108356
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.1-opw-575437-xal.
=== modified file 'account_payment/wizard/account_payment_populate_statement.py'
--- account_payment/wizard/account_payment_populate_statement.py	2012-01-31 13:36:57 +0000
+++ account_payment/wizard/account_payment_populate_statement.py	2012-06-01 14:57:21 +0000
@@ -95,8 +95,11 @@
                 }
                 voucher_id = voucher_obj.create(cr, uid, voucher_res, context=context)
                 voucher_line_dict =  False
-                if result['value']['line_ids']:
-                    for line_dict in result['value']['line_ids']:
+
+                # NOTE: we only check for lines on 'debit' as Payment Order only allow user
+                # to choose account.move.line with credit > 0, i.e payment will be on 'debit'
+                if result['value']['line_dr_ids']:
+                    for line_dict in result['value']['line_dr_ids']:
                         move_line = move_line_obj.browse(cr, uid, line_dict['move_line_id'], context)
                         if line.move_line_id.move_id.id == move_line.move_id.id:
                             voucher_line_dict = line_dict
@@ -120,4 +123,4 @@
 
 account_payment_populate_statement()
 
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to