[FIX] account_invoice.py: Replace the domain on partner_bank_id in customer refund and supplier refund

lp bug: https://launchpad.net/bugs/914282 fixed

bzr revid: jap@tinyerp.com-20120118101428-dxv29dtld7ufhqb7
This commit is contained in:
Jagdish Panchal (Open ERP) 2012-01-18 15:44:28 +05:30
parent 8fc14b07fc
commit 3bc2de99d2
1 changed files with 9 additions and 0 deletions

View File

@ -316,6 +316,15 @@ class account_invoice(osv.osv):
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']"):