Odoo - Open chatter integration

7,892 views

Published on

Odoo - Open chatter integration

  1. 1. OpenChatter Integration Thibault Delavallée, R&D Engineer
  2. 2. Messaging, OpenChatter Transversal app Discuss with customers on quotations Feedback on issues Mailing groups Discussions on tasks Subscribe to Newsletters · · · · · ThibaultDelavallée(tde@odoo.com)
  3. 3. Messaging, OpenChatter Transversal features OpenChatter Communication history Subscribe, Followers Action counters Mail gateway Aliases · · · · · · ThibaultDelavallée(tde@odoo.com)
  4. 4. Demo
  5. 5. OpenChatter / mail.thread OpenChatter in your model: classclass MyClass((Model):): _inherit == 'mail.thread' OpenChatter in your view <div<div class="oe_chatter">> <field<field name="message_follower_ids" widget="mail_followers"/>/> <field<field name="message_ids" widget="mail_thread"/>/> </div></div> And you are done ! ThibaultDelavallée(tde@odoo.com)
  6. 6. OpenChatter / mail.thread ThibaultDelavallée(tde@odoo.com)
  7. 7. OpenChatter / mail.thread What did it do ? new fields, linking messaging models _columns == {{ 'message_ids':: ...... # communication history 'message_follower_ids':: ...... # followers 'message_unread':: ...... # unread messages }} MyClasss MailMessage((Model):): ...... classclass MailMail((Model):): ...... classclass MailFollowers((Model):): ...... ThibaultDelavallée(tde@odoo.com)
  8. 8. OpenChatter / mail.thread What did it do ? new features defdef message_post((......):): defdef message_track((......):): defdef message_subscribe((......):): defdef message_process((......):): ThibaultDelavallée(tde@odoo.com)
  9. 9. Subtypes Subscription customization Automatic logging ThibaultDelavallée(tde@odoo.com)
  10. 10. Subtypes Define subtypes in XML <record<record id="mt_task_assigned" model="mail.message.subtype">> <field<field name="name">>Task Assigned</field></field> <field<field name="res_model">>project.task</field></field> <field<field name="default" eval="False"/>/> </record></record> ThibaultDelavallée(tde@odoo.com)
  11. 11. Subtypes Bind them to the model _columns == {{ 'user_id':: fields..many2one(('res.users',, track_visibility=='onchange'),), }} _track == {{ 'user_id':: {{ 'project.mt_task_assigned':: lambdalambda self,, cr,, uid,, obj,, c==None:: obj..user_id andand obj..user_id..id,, }} }} ThibaultDelavallée(tde@odoo.com)
  12. 12. NeedAction NeedAction in your model: classclass MyClass((Model):): _inherit == 'ir.needaction_mixin' Define a standard message_unread search filter <filter<filter string="Unread Messagingges" name="message_unread" domain="[('message_unread','=',True)]" help="Unread messages"/>/> ThibaultDelavallée(tde@odoo.com)
  13. 13. NeedAction Action counters Kanban ThibaultDelavallée(tde@odoo.com)
  14. 14. Email aliases Add alias management in your model: classclass MyClass((Model):): _inherits == {{'mail.alias':: 'alias_id'}} _columns == {{ 'alias_id':: fields..many2one(('mail.alias',, 'Alias'),), }} New record -> new alias ThibaultDelavallée(tde@odoo.com)
  15. 15. Aliases and Mail Gateway alias_contact -> privacy settings alias_force_thread_id -> redirect emails to a document's thread or create a new document · · ThibaultDelavallée(tde@odoo.com)
  16. 16. Summary Modular approach: inheritance -> features OpenChatter and Followers -> mail.thread Needaction -> ir.needaction_mixin Mail gateway and mail aliases -> mail.alias Customization through subtypes, tracking -> inheritance (python) -> light model decoration -> a bit of subtypes / aliases (XML) Play with it ! · · · · · · · · · ThibaultDelavallée(tde@odoo.com)
  17. 17. Thanks for your attention Questions ? tde@openerp.com

×