🎓 Chatter Tutorial - Learn Chatter Functionalities
A comprehensive tutorial module to master Odoo's chatter integration with practical examples and inline documentation
📚 What is This Module?
This is a complete tutorial module designed to teach developers how to implement Odoo's powerful chatter functionalities in their custom modules. With comprehensive inline documentation and working examples, you'll learn everything about messages, activities, and followers!
✨ Key Features
💬 Complete Chatter Integration
Learn how to add full chatter support with mail.thread and mail.activity.mixin inheritance
📝 Internal Messages
Discover how to create internal notes that are only visible to internal users
📨 Regular Messages
Master posting regular messages that notify all followers and can trigger emails
📅 Activity Scheduling
Learn to schedule activities programmatically with different types and deadlines
👥 Follower Management
Understand how the follower system works and how to manage subscribers
🔍 Field Tracking
Implement automatic change tracking on fields with the tracking parameter
📦 What's Included
- Contact Notes Model: A complete example model with full chatter integration
- Demo Buttons: Interactive buttons showing how to create messages from Python code
- Comprehensive Views: Tree, Form, Kanban, and Search views with best practices
- Inline Documentation: Extensive code comments explaining every aspect
- Working Examples: Real methods demonstrating message_post() and activity_schedule()
- Tutorial Page: Dedicated tab in the form view with learning resources
🎯 Learning Objectives
After installing and exploring this module, you'll be able to:
- Add chatter to any custom model using mail.thread inheritance
- Implement activity scheduling with mail.activity.mixin
- Create internal messages vs regular messages from Python code
- Schedule activities programmatically with custom parameters
- Enable field tracking to log changes automatically
- Structure form views properly with chatter widgets
- Manage followers and understand notification systems
🚀 How to Use
- Install the Module: Install
erpl_chatter_tutorialfrom Apps menu - Open the App: Navigate to "Chatter Tutorial" application
- Create a Contact Note: Click "New" to create your first contact note
- Explore Chatter: Scroll down to see the chatter section with followers, activities, and messages
- Try Demo Buttons: Go to the "Tutorial - Chatter Demo" tab and click the action buttons
- Review the Code: Check the source code in
models/contact_note.pyandviews/contact_note_views.xml
👨💻 Code Examples
Creating an Internal Message
def action_send_internal_message(self):
"""Post an internal message (note)"""
for record in self:
record.message_post(
body="This is an internal message!",
message_type='comment',
subtype_xmlid='mail.mt_note', # Internal note
)
return True
Scheduling an Activity
def action_create_activity(self):
"""Schedule a follow-up activity"""
for record in self:
activity_type = self.env.ref('mail.mail_activity_data_todo')
record.activity_schedule(
activity_type_id=activity_type.id,
summary='Follow-up on note',
note='Activity created from code',
user_id=record.user_id.id,
date_deadline=fields.Date.today() + timedelta(days=7)
)
return True
Form View with Chatter
<form string="Contact Note">
<sheet>
<!-- Your form fields here -->
</sheet>
<!-- Chatter Section -->
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="activity_ids" widget="mail_activity"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
📋 Technical Details
- Module Name: erpl_chatter_tutorial
- Version: 19.0.1.0.0
- Category: Tutorial
- Dependencies: base, mail
- License: OPL-1
- Odoo Version: 19.0+
🎓 Models Included
contact.note
Main tutorial model demonstrating chatter integration with:
mail.thread- Provides messaging and follower featuresmail.activity.mixin- Adds activity scheduling capabilities- Multiple field types with tracking enabled
- Methods for creating messages and activities programmatically
- State management with chatter notifications
contact.note.tag
Simple tag model for categorizing notes (demonstrates many2many relations)
💡 Best Practices Demonstrated
- Proper model inheritance for chatter support
- Using
tracking=Truefor automatic change logging - Correct usage of
message_post()with different subtypes - Activity scheduling with proper parameters
- Structured form views with chatter section
- Comprehensive inline code documentation
- Security access rights configuration
⚠️ Important Notes
- This module is for educational purposes to learn chatter implementation
- All code includes extensive inline comments for learning
- Review the source code to understand how each feature works
- Test the demo buttons to see chatter in action
📖 Documentation
The module includes comprehensive documentation in the code:
- models/contact_note.py: Detailed docstrings explaining each method and field
- views/contact_note_views.xml: XML comments explaining view structure and widgets
- Tutorial Tab: In-app documentation with usage instructions
🔧 Installation
- Download or clone this module to your Odoo addons directory
- Update the apps list in Odoo
- Search for "Chatter Tutorial" in the Apps menu
- Click Install
- Navigate to the "Chatter Tutorial" application to start learning!
🆘 Support & Contact
This module is developed and maintained by ERP Labz. For support, customization, or custom Odoo development services, please contact us:
- Website: erplabz.com
- Company: ERP Labz
📜 License
This module is licensed under OPL-1 (Odoo Proprietary License v1.0).
🎉 Ready to Master Chatter?
Install this module now and explore all the examples! The best way to learn is by experimenting with the working code and reading the comprehensive inline documentation.
Happy Learning! 🚀
Please log in to comment on this module