Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

get field.related column from foreign key error - Field '_asdict' does not exist in object browse_record

By
rais
on 4/27/15, 2:23 AM 869 views

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'),


 

1

Ahmed M.Elmubarak

--Ahmed M.Elmubarak--
2988
| 5 3 5
Sudan
--Ahmed M.Elmubarak--


Ahmed M.Elmubarak
On 4/27/15, 4:20 AM

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 ..

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 4/27/15, 2:23 AM
Seen: 869 times
Last updated: 4/27/15, 7:09 PM