How to do it...

Follow these steps to add chatter on the records of the library.book.rent model:

  1. Add the mail module dependency in the __manifest__.py file:
...
'depends': ['base', 'mail'],
...
  1. Inherit mail.thread in the Python definition of the library.book.rent model:
class LibraryBookRent(models.Model):
_name = 'library.book.rent'
_inherit = ['mail.thread']
...
  1. Add chatter widgets on the form view of the library.book.rent model:
...
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
...

Install the my_library module to see the changes in action:

As shown in the preceding screenshot, after installing the module you will be able to see chatter in the form view.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset