Live Chat
True
FAQs
Development

Custom Module: How to add messages?

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,

How can i do that?


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">
        ...
        </form>
        <sheet>
        ...
        </sheet>
        <div class="oe_chatter">
            <field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/>
            <field name="message_ids" widget="mail_thread"/>
        </div>
    </field>
</record>


Was this article helpful?

FAQ HOME

To install this Web App in your iPhone/iPad press and then Add to Home Screen.