跳至內容
選單
此問題已被標幟
1 回覆
6658 瀏覽次數

In crm.phonecall, I have following new fields.

'x_project_id': fields.many2one('res.partner','Project / Site'),
'x_email': fields.related('x_project_id', 'email', type='char', string='Email',store=False),
'x_proj_state': fields.related('x_project_id', 'state_id', string='Project State',store=False),

There is no problem in displaying x_email and x_project_id. However, when I want to get value x_proj_state in my tree view or form view

<field name="x_proj_state"  readonly="1"/>  

then it gives following error

WARNING penerp.osv.orm.browse_record.res.country.state: Field '_asdict' does not exist in object 'browse_record(res.country.state, 53)'


in res.partner state_id is described as fields.many2one('res.country.state','State'),


 

頭像
捨棄
最佳答案

Hi,

Try to add type and relation :

 'x_project_state': fields.related('x_project_id', 'state_id', string="Project State", type="many2one", relation="res.country.state", store=False), 

It worked for me ...

Regards ..

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
2月 25
8597
3
1月 19
7181
2
6月 15
8161
0
6月 15
4004
1
3月 15
5062