Jagdish Panchal (Open ERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-bug-914282-jap into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #914282 in OpenERP Addons: "Wrong bank account domain on refunds"
  https://bugs.launchpad.net/openobject-addons/+bug/914282

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-914282-jap/+merge/89000

Hello,

account_invoice.py:
Replace the domain on partner_bank_id in customer refund and supplier refund 
--fixes=lp:914282

Thanks
JAP
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-914282-jap/+merge/89000
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-bug-914282-jap.
=== modified file 'account/account_invoice.py'
--- account/account_invoice.py	2012-01-10 14:09:12 +0000
+++ account/account_invoice.py	2012-01-18 10:23:36 +0000
@@ -316,6 +316,15 @@
                 res['fields'][field]['selection'] = journal_select
 
         doc = etree.XML(res['arch'])
+        
+        if context.get('type', False):
+            for node in doc.xpath("//field[@name='partner_bank_id']"):
+                if context['type'] == 'in_refund':
+                    node.set('domain', "[('partner_id.ref_companies', 'in', [company_id])]")
+                if context['type'] == 'out_refund':
+                    node.set('domain', "[('parnter_id', '=', parnter_id)]")
+            res['arch'] = etree.tostring(doc)
+                
         if view_type == 'search':
             if context.get('type', 'in_invoice') in ('out_invoice', 'out_refund'):
                 for node in doc.xpath("//group[@name='extended filter']"):

_______________________________________________
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