Odoo Help


Project Issue - Subject

Dave Ellison
on 1/2/14, 12:19 PM 2,520 views


On sending emails to customers, the subject is from the name field. Is there any way to concatenate the record ID+name? On emails being sent we are looking for the format:

'id'+' - '+'subject'

Ok, based on the below comment, I have this method. My Python is not advanced enough to know what I should do with this method after overriding or even if I were to adjust this to test.

    def get_record_data(self, cr, uid, model, res_id, context=None):
    """ Returns a defaults-like dict with initial values for the composition
        wizard when sending an email related to the document record
        identified by ``model`` and ``res_id``.

        :param str model: model name of the document record this mail is
            related to.
        :param int res_id: id of the document record this mail is related to
    doc_name_get = self.pool.get(model).name_get(cr, uid, [res_id], context=context)
    record_name = False
    if doc_name_get:
        record_name = doc_name_get[0][1]
    values = {
        'model': model,
        'res_id': res_id,
        'record_name': record_name,
    if record_name:
        values['subject'] = 'Re: %s' % record_name
    return values



Pinakin Nayi (pna)

--Pinakin Nayi (pna)--
| 2 1 5
Ahmedabad, India
--Pinakin Nayi (pna)--

He has good skills in problem identification and implementation of effective solutions. He is working in RD India validation team.

Skype: pinakinerp

LinkedIn : https://www.linkedin.com/in/pinakin-nayi-2a33103a/


Pinakin Nayi (pna)
On 1/3/14, 3:10 AM


You can do this by two ways, either in particular model define def name_get method and append string whatever you want.

Or You can override mail.compose.message model and override def get_record_data method and change record_name.


Hi,thanks for the response. I am not seeing this method in project_issue.py. Am I looking in the wrong place?

Dave Ellison
on 1/3/14, 6:12 AM

Hi, you need to override that method, means if you want to do it by mail.compose.message just inherit mail.compose.message and override def get_record_data method and customize it.

Pinakin Nayi (pna)
on 1/3/14, 8:09 AM

About This Community

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


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 1/2/14, 12:19 PM
Seen: 2520 times
Last updated: 3/16/15, 8:10 AM