Odoo Help


1 Answer

Shawn Varghese United Arab Emirates

--Shawn Varghese--
| 5 3 10
Dubai, United Arab Emirates
--Shawn Varghese--

Shawn Varghese United Arab Emirates
3/23/16, 3:34 PM

Hi Yenthe,

Are you referring to the message subtypes? You can normally configure that in the following way:

Example taken from sale.py:


def _track_subtype(self, init_values):


if 'state' in init_values and self.state == 'sale':

return 'sale.mt_order_confirmed'

elif 'state' in init_values and self.state == 'sent':

return 'sale.mt_order_sent'

return super(SaleOrder, self)._track_subtype(init_values)

We use the _track_subtype method to track the state variable. Therefore, whenever the state is changed and moves to 'sale' state, the message subtype sale.mt_order_confirmed is used for the automatic e-mail to followers. This subtype will be defined in XML as :

<record id="mt_order_confirmed" model="mail.message.subtype">

<field name="name">Sales Order Confirmed</field>

<field name="res_model">sale.order</field>

<field name="default" eval="False"/>

<field name="description">Quotation confirmed</field>


Here, if you change the default field value to true, followers of the document will automatically get subscribed to this message type. I imagine something similar will have been done for the Issues module in the screenshot you shared.

Also, the automatic e-mail that gets sent will include details of the changes. You can choose which details to include by using the track_visibility parameter:


     state = fields.Selection([

('draft', 'Quotation'),

('sent', 'Quotation Sent'),

('sale', 'Sale Order'),

('done', 'Done'),

('cancel', 'Cancelled'),

], string='Status', readonly=True, copy=False, index=True, track_visibility='onchange', default='draft')


Hope this is what you were referring to.

ePillars Systems LLC, Shawn Varghese United Arab Emirates
3/23/16, 3:42 PM

Also, isn't the Discussions default to True? I just tried adding a customer as a follower, but I found that they were automatically subscribed to Discussions... Also, if you navigate to Settings > Technical > Subtypes, you can configure which ones should be subscribed by default.

Yenthe Van Ginneken Belgium
3/29/16, 3:04 AM

@Shawn thank you for the answer but I'm not talking about the states at the top of a record (the progressbar), I'm talking about the followers on a record and how to automatically give them specific settings. The Discussions its followers are not by default configured by my case because I add them through Python, which I'm doing besides the default behaviour.

Ask a Question
Keep Informed
1 follower(s)
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