This question has been flagged
4 Replies
8663 Views

Hi,

I’d like to add a field to project.project.form that shows a field I’ve defined in the res.partner model called ‘x_client_code’.

If I just add the field I get a validate error when I try to save the view. I must need to tell it where to find the info, but I don’t know how.

Here’s a link to the code: http://pastebin.com/TSnhUwgM.

Can anyone help please? Thanks.

Avatar
Discard
Best Answer

 John,

You have to first take a field(type depends on which data you want to show) in project.project and then 
1) either you can fill its field(field in project.project) value when the original field is bieng updated(in write or create method of original fields master) or
2) you can override the Read method of project.project and write the original fields data into this field
(Note: prefer to go with first menthod)


Thanks

Pawan

Avatar
Discard

Hello, Pawan. I have a situation almost identical to the one Anthone had. Only that the original field is in cre,lead (priority) and I want to show that in the sales.order model. I definitely believe the first method is the way to go but have not been able to achieve it yet. I only work with the GUI and do not want to resort to Python or programming. Can you inform about how pass the info from one field to the other? The custom field x_saleorder_priority has been created mimicking the crm.lead priority. Thank you in advance

Author Best Answer

Hi, I'm using version 8. I'm not working in Python. Everything is being done through the web interface by adding to data models and creating or editing existing form views. I'll have a go at creating the related field in project.project class, thanks.

Avatar
Discard
Best Answer

Which version of Odoo are you using?

You need to create a related field in project.project class to read a field from res.partner passing by parter_id field.

Avatar
Discard
Best Answer

could you please show me  the python code ?

Avatar
Discard