Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
7433 Lượt xem

estimation_id = fields.Many2many('res.users', default=lambda self:self.env.user, domain=lambda self: [("groups_id", "=",self.env.ref( "estimation.group_user_hide" ).id)], index=True, track_visibility='onchange', string='Estimation Asign To')

new_user_ids = [user.id for user in rec.estimation_id if user.id not in user_ids[rec.id]]

when i used above field that time i got selected user's user_id but i also need to get the email_id of user.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

To get email id from user use the following code

email = user.partner_id.email

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi Kiran,

Try following Code

new_user_ids = [user.email for user in rec.estimation_id if user.id not in user_ids[rec.id]]

Thanks.

Ảnh đại diện
Huỷ bỏ
Tác giả

@Gokulakrishnan Hello i used your updated code but email don't sent on this email ids. you have any other solution to using same code and send the mail

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 2 22
3324
2
thg 4 21
9883
3
thg 11 19
5077
0
thg 10 19
3960
0
thg 7 19
4953