Search code examples
odooodoo-8openerp-8

Odoo: add history and comments to my custom model


I've created a custom model in Odoo and I'd like to add the same history&comments section to its form view as built-in Odoo models have (e.g. customers).

Is that possible?


Solution

  • Firstly you need your model to inherit from mail.thread.

    _inherit = 'mail.thread'
    

    And then add the div at the end of your form.

            <div class="oe_chatter">
                <field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/>
                <field name="message_ids" widget="mail_thread"/>
            </div>
    

    and you should be away.

    Presentation on it here http://www.slideshare.net/openobject/odoo-open-chatter-integration