Janik Vonrotz


1 min read

Odoo Development: Add activity button

The activity button is part of the chatter. Every model form can have activities. I will show how you can enable the activity button for your model form using the mixin class.

The examples are based on the Odoo App Certificate Planner.

First inherit the classes in your model.

models/change.py

class Change(models.Model):
	_inherit = ['mail.thread', 'mail.activity.mixin']

Next update the form.

views/change.xml

        </sheet>
        <div class="oe_chatter">
          <field name="message_follower_ids" widget="mail_followers"/>
          <field name="message_ids" widget="mail_thread"/>
          <field name="activity_ids" widget="mail_activity"/>
        </div>
      </form>
    </field>
  </record>

</odoo>

And you will see the message and activity buttons on your form.

Categories: Odoo
Tags: odoo , development , tutorial
Improve this page
Show statistic for this page