[FIX] account: fixed onchange of type in the account.journal form view
bzr revid: qdp-launchpad@tinyerp.com-20101222101655-pagdwermbumdffx8
This commit is contained in:
parent
8be856082e
commit
333f5b21c2
|
@ -708,7 +708,7 @@ class account_journal(osv.osv):
|
||||||
|
|
||||||
return self.name_get(cr, user, ids, context=context)
|
return self.name_get(cr, user, ids, context=context)
|
||||||
|
|
||||||
def onchange_type(self, cr, uid, ids, type, currency):
|
def onchange_type(self, cr, uid, ids, type, currency, context=None):
|
||||||
obj_data = self.pool.get('ir.model.data')
|
obj_data = self.pool.get('ir.model.data')
|
||||||
user_pool = self.pool.get('res.users')
|
user_pool = self.pool.get('res.users')
|
||||||
|
|
||||||
|
@ -730,7 +730,6 @@ class account_journal(osv.osv):
|
||||||
user = user_pool.browse(cr, uid, uid)
|
user = user_pool.browse(cr, uid, uid)
|
||||||
if type in ('cash', 'bank') and currency and user.company_id.currency_id.id != currency:
|
if type in ('cash', 'bank') and currency and user.company_id.currency_id.id != currency:
|
||||||
view_id = 'account_journal_bank_view_multi'
|
view_id = 'account_journal_bank_view_multi'
|
||||||
|
|
||||||
data_id = obj_data.search(cr, uid, [('model','=','account.journal.view'), ('name','=',view_id)])
|
data_id = obj_data.search(cr, uid, [('model','=','account.journal.view'), ('name','=',view_id)])
|
||||||
data = obj_data.browse(cr, uid, data_id[0], context=context)
|
data = obj_data.browse(cr, uid, data_id[0], context=context)
|
||||||
|
|
||||||
|
|
|
@ -411,7 +411,7 @@
|
||||||
<group colspan="4" col="6">
|
<group colspan="4" col="6">
|
||||||
<field name="name" select="1"/>
|
<field name="name" select="1"/>
|
||||||
<field name="code" select="1"/>
|
<field name="code" select="1"/>
|
||||||
<field name="type" on_change="onchange_type(type, currency)"/>
|
<field name="type" on_change="onchange_type(type, currency, context)"/>
|
||||||
</group>
|
</group>
|
||||||
<notebook colspan="4">
|
<notebook colspan="4">
|
||||||
<page string="General Information">
|
<page string="General Information">
|
||||||
|
|
Loading…
Reference in New Issue