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

How to send a message/mail to a specific user within the system from an admin of that system?

By
Katherine Grace Serador
on 5/22/14, 8:40 PM 995 views

How to code the sending a mail/message to a specific registered user of the system from the admin of the system?

For example, in a form then there is a field (many2one ), there, i need to select a specific user that is registered in the system. And then there is a button which will be pressed so it will send a mail/message to the selected user. The mail/message will come from the admin of the system. The user will have to receive it when the user logged in, and will see it in his/her inbox. The type of the message is comment.

 

Please help me with this. And please give also a sample code.

 

OpenERP version 7

 

Im a newbie in openerp.

0
Rajkumar
On 5/23/14, 1:00 AM

Hi,

# create form with the fields as below in xml and get the fields from your form in py and create a record in mail.mail
it will automatically send to user('email_to')
And you have a configuration part in Setting -> Technical -> Scheduler
configure your interval time in Email Queue Manager

email_from = login user mail-id
email_to = "what you choose (res.users many2one)"
sub = " "
body_html = " "


vals ={'email_from':email_from,
                        'email_to':email_to,
                        'state': 'outgoing',
                            'subject': sub,
                            'body_html': body,
                            'auto_delete': True}

self.pool.get('mail.mail').create(cr, uid, vals, context=context)

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

2 follower(s)

Stats

Asked: 5/22/14, 8:40 PM
Seen: 995 times
Last updated: 3/16/15, 8:10 AM