Odoo Help


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.


Custom Module: How to add messages?

on 5/3/13, 10:28 AM 9,871 views

I'm creating a Custom module, and i wish to add them the possibility to add messages, follow it, add attachments, just like at the bottom of the Customer form.

image description

How can i do that?


Andreas Maertens

--Andreas Maertens--
| 5 5 7
Finsterwalde, Germany
--Andreas Maertens--

I develop odoo8.0 modules

Andreas Maertens
On 5/3/13, 10:37 AM

You need to inherit your module from "mail.thread" also. That makes adding it possible.

e.g. as here (model.py):

class sale_order(osv.osv):
    _name = "sale.order"
    _inherit = ['mail.thread', 'ir.needaction_mixin']

Then you need to add the Thread to your view (view.xml):

<record id="view_order_form" model="ir.ui.view">
    <field name="name">sale.order.form</field>
    <field name="model">sale.order</field>
    <field name="arch" type="xml">
        <form string="Sales Order" version="7.0">
        <div class="oe_chatter">
            <field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/>
            <field name="message_ids" widget="mail_thread"/>

That's all you need to do. :)

This did work! Thank you!

on 5/3/13, 10:52 AM

Thank you!!! I'ts Work!!!

Mamfredy Mejia
on 11/12/13, 11:51 PM
On 5/3/13, 10:48 AM
     <div class="oe_chatter">
            <field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/>
            <field name="message_ids" widget="mail_thread"/>

just add this line at the bottom of your code

yeah that didn't really work...it said invalid xml architecture.

on 5/3/13, 10:50 AM

try to add above snippet just before the closing </form> tag.

on 5/3/13, 1:49 PM

Hi, if i use this <field name="message_ids" widget="mail_thread"/>, how can i set what messages will be display on this view?

(if i want to display all partner related emails outgoing (in & outgouing) example...

on 5/6/13, 9:54 AM
Mister One
On 9/15/16, 2:15 PM

Good night,

Please, can you tell me if this is working on odoo 8 ?

It works on Odoo 8 ?

Mister One
on 9/15/16, 2:17 PM
Nick Athanasoulas
On 11/7/13, 8:42 AM

Hi there, In Online Demo chatter is working at Human Resources, employee forms by default. But in my OpenERP v7 setup it doesn't. It does work on other forms but not in employees forms.

I think all I have to do is to enable oe_chatter in employee form. I dont know much on openERP, so I managed to enter developer mode and go to Database Structure - Models - hr.employee. I click on the "Edit formview", but I cannot find "mail_thread" to inherit it. I can only add the class code in the form.

I just need a simple solution on how to enable oe_chatter in employee form, because its working everywhere else in my OpenERP setup. I am strugling to find a solution for over 2 days now but with no luck.

Please help..

Nanie BE
On 8/12/14, 9:49 AM


how about if I regroup in one module all of the adding a group in the followers for example in purchase, sales..... 

For example when purchase goes Sent for Waiting approval, one group 1 is automatically added in the followers.

 this purchase goes to waiting approval for approved, one group 2 is automatically added in the followers.

How to do, I want to gather all of this case in one module?

Dr Obx
On 1/19/16, 4:18 AM

Just found it, excellent. That's what I needed :)

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

1 follower(s)


Asked: 5/3/13, 10:28 AM
Seen: 9871 times
Last updated: 9/15/16, 2:15 PM