Skip to content

Latest commit

 

History

History
50 lines (34 loc) · 1.9 KB

5_chatter.md

File metadata and controls

50 lines (34 loc) · 1.9 KB

Send Message, Log and Activity Buttons in form views

  • First we have to inherit mail.thread and mail.activity.mixin module in the specific model inside the class. Here in the patient.py file.

    _inherit = ['mail.thread', 'mail.activity.mixin']
  • Add inherited module name in the depends in __manifest__.py.

    'depends': ['mail']
  • Add this code to the patient_view.xml inside the form tag and after the sheet tag. file for viewing chatter options. It will integrate messaging features and activity to the model. It will look like this.

    <div class="oe_chatter">
        <field name="message_follower_ids"/>
        <field name="activity_ids"/>
        <field name="message_ids"/>
    </div>

    chatter1

  • In the Schedule activity we can schedule based on different activities like Todo, Call etc. Explore this by your own.

    chatter2

  • Check this code examples

  • Task

    • Try to add chatter in doctor and appointment model.

Track field value changes and log in chatter

  • For tracking field value changes we have to add an attribute named tracking=True in that field in .py file. Example:

    name = fields.Char(string='Patient Name', required=True, tracking=True)

    And it will save a log in the chatter and also who have changed the value. Try to add tracking in other fields in doctor.py, patient.py and appointment.py file.

    chatter3

🚀 Happy Coding ! 🔥