Purnendu Singh (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-bug-834091-psi into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #834091 in OpenERP Addons: "account_payment not allowing selection of 
invoices for payment"
  https://bugs.launchpad.net/openobject-addons/+bug/834091

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-834091-psi/+merge/74579

Hello,

Fixes: https://bugs.launchpad.net/openobject-addons/+bug/834091
       account_payment not allowing selection of invoices for payment


Thanks,
Purnendu Singh

-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-834091-psi/+merge/74579
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-bug-834091-psi.
=== modified file 'account_payment/wizard/account_payment_create_order_view.xml'
--- account_payment/wizard/account_payment_create_order_view.xml	2011-01-27 13:34:57 +0000
+++ account_payment/wizard/account_payment_create_order_view.xml	2011-09-08 11:03:26 +0000
@@ -26,7 +26,8 @@
             <field name="type">form</field>
             <field name="arch" type="xml">
 			<form string="Search Payment lines">
-			    <group col="4" colspan="6">
+				<group col="4" colspan="6">
+					<field name="entries"/>
 				</group>
 				<separator colspan="4"/>
 			    <group col="2" colspan="4">

=== modified file 'account_payment/wizard/account_payment_order.py'
--- account_payment/wizard/account_payment_order.py	2011-02-15 09:20:57 +0000
+++ account_payment/wizard/account_payment_order.py	2011-09-08 11:03:26 +0000
@@ -29,7 +29,7 @@
     Create a payment object with lines corresponding to the account move line
     to pay according to the date and the mode provided by the user.
     Hypothesis:
-    - Small number of non-reconcilied move line, payment mode and bank account type,
+    - Small number of non-reconciled move line, payment mode and bank account type,
     - Big number of partner and bank account.
 
     If a type is given, unsuitable account Entry lines are ignored.
@@ -48,12 +48,11 @@
     def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
         res = super(payment_order_create, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=False)
         if context and 'line_ids' in context:
-            view_obj = etree.XML(res['arch'])
-            child = view_obj.getchildren()[0]
-            domain = '[("id", "in", '+ str(context['line_ids'])+')]'
-            field = etree.Element('field', attrib={'domain': domain, 'name':'entries', 'colspan':'4', 'height':'300', 'width':'800', 'nolabel':"1"})
-            child.addprevious(field)
-            res['arch'] = etree.tostring(view_obj)
+            doc = etree.XML(res['arch'])
+            nodes = doc.xpath("//field[@name='entries']")
+            for node in nodes:
+                node.set('domain', '[("id", "in", '+ str(context['line_ids'])+')]')
+            res['arch'] = etree.tostring(doc)
         return res
 
     def create_payment(self, cr, uid, ids, context=None):
@@ -81,14 +80,14 @@
             elif payment.date_prefered == 'fixed':
                 date_to_pay = payment.date_scheduled
             payment_obj.create(cr, uid,{
-                'move_line_id': line.id,
-                'amount_currency': line.amount_to_pay,
-                'bank_id': line2bank.get(line.id),
-                'order_id': payment.id,
-                'partner_id': line.partner_id and line.partner_id.id or False,
-                'communication': line.ref or '/',
-                'date': date_to_pay,
-                'currency': line.invoice and line.invoice.currency_id.id or False,
+                    'move_line_id': line.id,
+                    'amount_currency': line.amount_to_pay,
+                    'bank_id': line2bank.get(line.id),
+                    'order_id': payment.id,
+                    'partner_id': line.partner_id and line.partner_id.id or False,
+                    'communication': line.ref or '/',
+                    'date': date_to_pay,
+                    'currency': line.invoice and line.invoice.currency_id.id or False,
                 }, context=context)
         return {'type': 'ir.actions.act_window_close'}
 

_______________________________________________
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