[IMP] account_payment: Improve the view and query for suitable_bank_types

bzr revid: psi@tinyerp.co.in-20100906065130-bs59hpk6hwcu3c1n
This commit is contained in:
psi (Open ERP)
2010-09-06 12:21:30 +05:30
parent 45d0677764
commit bc7ffe3b02
2 changed files with 3 additions and 4 deletions
+2 -3
View File
@@ -43,9 +43,8 @@ class payment_mode(osv.osv):
for the given payment type code"""
if not payment_code:
return []
cr.execute(""" select t.code
from res_partner_bank_type t
join res_partner_bank pb on (t.id = pb.bank)
cr.execute(""" select pb.state
from res_partner_bank pb
join payment_mode pm on (pm.bank_id = pb.id)
where pm.id = %s """, [payment_code])
return [x[0] for x in cr.fetchall()]
@@ -59,7 +59,7 @@
<field name="arch" type="xml">
<form string="Payment Mode">
<field name="name" select="1"/>
<field name="journal"/>
<field name="journal" select="1"/>
<field name="bank_id"/>
<field name="company_id" select="1" widget='selection' groups="base.group_multi_company"/>
</form>