Skip to Content
Menu
This question has been flagged
1 Reply
2197 Views

i have custom module and i got the project name by using the below code :-

project_name = fields.many2one('project.project', string='Project Name')

and also got the project manager name by using the 'related' attribute like :-

project_manager = fields.Char(string='Project Manager', related='project_name.user_id)

and i need one more field that is Project Manager's email id automatically. How can i get the email id of the project manager of the selected project

Please help me to fix this


Avatar
Discard
I got a KeyError while executing this

field = target._fields[name]
KeyError: 'user_id'
any idea ...

On Sat, Nov 2, 2019 at 5:24 PM Ravi Gadhia <raviit2004@gmail.com> wrote:

A new answer on How to get the Project manager's email id has been posted. Click here to access the post :

See post

Sent by Odoo S.A. using Odoo.

it means `user_id` field doesn't exist in the target model

Hi  Yanthe
any solution ?????

On Sat, Nov 2, 2019 at 2:48 PM Yenthe Van Ginneken <yenthe@oocademy.com> wrote:

Une nouvelle question How to get the Project manager's email id le Aide a été publiée. Cliquez ici pour accéder à la question :

Voir la question


Envoyé par Odoo S.A. using Odoo.

Best Answer

project_email = fields.Char(string='Project Manager Email', related='project_name.user_id.email)


Avatar
Discard
Related Posts Replies Views Activity
1
Apr 24
1473
1
Dec 23
2742
2
Apr 23
4986
2
Nov 22
2420
0
Nov 22
2739