[FIX] analytic: fixed view that have an onchange function returning a field which is not in the view

bzr revid: qdp-launchpad@openerp.com-20121004162611-mzjh291l4rlwwk4m
This commit is contained in:
Quentin (OpenERP) 2012-10-04 18:26:11 +02:00
parent 003e5ebffb
commit 28208c7f5c
2 changed files with 2 additions and 1 deletions

View File

@ -163,7 +163,7 @@ class account_analytic_account(osv.osv):
'date': fields.date('Date End', select=True),
'company_id': fields.many2one('res.company', 'Company', required=False), #not required because we want to allow different companies to use the same chart of account, except for leaf accounts.
'state': fields.selection([('template', 'Template'),('draft','New'),('open','In Progress'), ('cancelled', 'Cancelled'),('pending','To Renew'),('close','Closed')], 'Status', required=True,),
'currency_id': fields.function(_currency, fnct_inv=_set_company_currency,
'currency_id': fields.function(_currency, fnct_inv=_set_company_currency, #the currency_id field is readonly except if it's a view account and if there is no company
store = {
'res.company': (_get_analytic_account, ['currency_id'], 10),
}, string='Currency', type='many2one', relation='res.currency'),

View File

@ -24,6 +24,7 @@
<field name="partner_id" on_change="on_change_partner_id(partner_id, name)" attrs="{'required':[('type','=','contract')]}"/>
<field name="manager_id"/>
<field name="code"/>
<field name="currency_id" attrs="{'invisible': ['|',('type', &lt;&gt;, 'view'), ('company_id', &lt;&gt;, False)]}"/>
</group>
<group>
<field name="type"/>