← Back to team overview

account-payment-team team mailing list archive

lp:~pedro.baeza/account-payment/6.1-account_payment_extensiones_fixes into lp:account-payment

 

Pedro Manuel Baeza has proposed merging lp:~pedro.baeza/account-payment/6.1-account_payment_extensiones_fixes into lp:account-payment.

Requested reviews:
  Account Payment (account-payment-team)

For more details, see:
https://code.launchpad.net/~pedro.baeza/account-payment/6.1-account_payment_extensiones_fixes/+merge/157172

[FIX] account_payment_extension: Bank account not fetched when using select invoices wizard in payment order.
[IMP] account_payment_extension: Dead code removed in wizard/account_payment_order.py, 'search_entries' method.
[FIX] account_payment_extension: correct handling of zero amount in select invoices wizard.
-- 
https://code.launchpad.net/~pedro.baeza/account-payment/6.1-account_payment_extensiones_fixes/+merge/157172
Your team Account Payment is requested to review the proposed merge of lp:~pedro.baeza/account-payment/6.1-account_payment_extensiones_fixes into lp:account-payment.
=== modified file 'account_payment_extension/__openerp__.py'
--- account_payment_extension/__openerp__.py	2012-11-01 21:49:33 +0000
+++ account_payment_extension/__openerp__.py	2013-04-04 17:24:23 +0000
@@ -6,6 +6,8 @@
 #                       Jordi Esteve <jesteve@xxxxxxxxxxxxxxx>
 #    AvanzOSC, Avanzed Open Source Consulting
 #    Copyright (C) 2011-2012 Iker Coranti (www.avanzosc.com). All Rights Reserved
+#    Copyright (c) 2013 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com)
+#                       Pedro Manuel Baeza <pedro.baeza@xxxxxxxxxxxxxxxxxx>
 #    $Id$
 #
 #    This program is free software: you can redistribute it and/or modify
@@ -25,7 +27,7 @@
 
 {
     "name" : "Account Payment Extension",
-    "version" : "1.1",
+    "version" : "1.2",
     "author" : "Zikzakmedia SL",
     "category" : "Accounting & Finance",
     "website" : "www.zikzakmedia.com",

=== modified file 'account_payment_extension/wizard/account_payment_order.py'
--- account_payment_extension/wizard/account_payment_order.py	2012-11-01 21:49:33 +0000
+++ account_payment_extension/wizard/account_payment_order.py	2013-04-04 17:24:23 +0000
@@ -103,16 +103,13 @@
 
         selected_ids = []
         if amount:
-            if payment.mode and payment.mode.require_bank_account:
-                line2bank = pool.get('account.move.line').line2bank(cr, uid, line_ids, payment.mode.id, context)
-            else:
-                line2bank = None
-            # If user specified an amount, search what moves match the criteria taking into account
-            # if payment mode allows bank account to be null.
+            # If user specified an amount, search what moves match the criteria
             for line in pool.get('account.move.line').browse(cr, uid, line_ids, context):
                 if abs(line.amount_to_pay) <= amount:
                     amount -= abs(line.amount_to_pay)
                     selected_ids.append( line.id )
+        else:
+            selected_ids = line_ids
 
         context.update({'line_ids': selected_ids})
         model_data_ids = mod_obj.search(cr, uid,[('model', '=', 'ir.ui.view'), ('name', '=', 'view_create_payment_order_lines')], context=context)
@@ -139,7 +136,7 @@
             return {'type': 'ir.actions.act_window_close'}
 
         payment = order_obj.browse(cr, uid, context['active_id'], context=context)
-        t = None
+        t = payment.mode and payment.mode.id or None
         line2bank = line_obj.line2bank(cr, uid, line_ids, t, context)
         ## Finally populate the current payment with new lines:
         for line in line_obj.browse(cr, uid, line_ids, context=context):


Follow ups