How it works...

This feature only works if your model has inherited the mail.thread model. To show the document on the side of any form view, you will need to add an empty <div> with the o_attachment_preview class before the chatter elements. That's it, the documents attached in the chatter will be displayed on the side of the form view.

By default, the pdf and image type documents will be displayed in ascending order by date. You can change this behavior by providing extra options, which include the following:

  • type: You need to pass the list of document types you want to allow. Only two values are possible: pdf and image. For example, if you want to display only pdf type images, you can pass {'type': ['pdf']}.
  • order: Possible values are asc and desc. These allow you to show documents in ascending order or descending order of the document creation date.
..................Content has been hidden....................

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