1. OpenChatter and
mail integration
Thibault Delavallée
OpenERP Community, Customers and Partners summit 10 April 2012 1
2. Introduction
● Being Social … what is it ?
OpenERP Community, Customers and Partners summit 10 April 2012
3. Introduction
● Being Social … what is it ?
– more Facebook posts than
emails sent
– companies using Twitter average
2 times more leads
– networking through social medias
more and more crucial
→ not only Buzz !
OpenERP Community, Customers and Partners summit 10 April 2012
4. Introduction
● Being Social … what is it ?
– more Facebook posts than
emails sent
– companies using Twitter average
2 times more leads
– networking through social medias
more and more crucial
→ not only Buzz !
● People have incorporated social media in their lifes
● What about companies ?
OpenERP Community, Customers and Partners summit 10 April 2012
5. Introduction
● Daily life in a company ...
– invoices to send, receive, (re)encode, phonecalls, emails, …
→ inefficient !
– still struggling with stone age !
● This process should be improved …
● … and OpenERP will do it !
OpenERP Community, Customers and Partners summit 10 April 2012
6. Introduction
● Daily life in a company ...
– invoices to send, receive, (re)encode, phonecalls, emails, …
→ inefficient !
– still struggling with stone age !
● This process should be improved …
● … and OpenERP will do it !
OpenChatter, a new social feature !
OpenERP Community, Customers and Partners summit 10 April 2012
7. What is OpenChatter ?
● Because a demo is worth a thousand words …
OpenERP Community, Customers and Partners summit 10 April 2012
8. What is OpenChatter ?
● Because a demo is worth a thousand words …
● Summary
– collection of mail.message
– managed by mail.thread
– possibly overridden by the addon
– displayed through Thread and Wall widgets
● Let's dive into some technical aspects !
OpenERP Community, Customers and Partners summit 10 April 2012
9. What is OpenChatter ?
● Transparent messaging system
● Discussions about documents
● Integration of emails
● System notifications and res logs cleaning
● Threaded design
● Discussion groups
● Easy internal and external user inclusion in a discussion
● Follow mechanism
● Central feeds page: Wall
● “Need action” mechanism
● Easy addon update to OpenChatter
OpenERP Community, Customers and Partners summit 10 April 2012
10. Outline
● Introduction
● What is OpenChatter ?
● Internals and API
● Thread widget and Wall
● Share and invite
● Need action mechanism
● How to use OpenChatter in my addon ?
● Work in progess
● Conclusion
OpenERP Community, Customers and Partners summit 10 April 2012
11. Outline
● Introduction
● What is OpenChatter ?
● Internals and API
● Thread widget and Wall
● Share and invite
● Need action mechanism
● How to use OpenChatter in my addon ?
● Work in progess
● Conclusion
OpenERP Community, Customers and Partners summit 10 April 2012
12. mail.message
● Models every kind of message, not just emails
● type: notification, comment, email
– notification: state update, stage change, logs
→ no more res.log
→ screen cleaning
– comment: user comments
– email: emails going from and to the mail gateway
OpenERP Community, Customers and Partners summit 10 April 2012
13. mail.message
● Models every kind of message, not just emails
● type: notification, comment, email
● subtype: plain, html → body_text, body_html
– body: calculated body matching subtype
– comments and notifications in html
OpenERP Community, Customers and Partners summit 10 April 2012
14. mail.message
● Models every kind of message, not just emails
● type: notification, comment, email
● subtype: plain, html
● threaded design: parent_id
OpenERP Community, Customers and Partners summit 10 April 2012
15. mail.message
● Models every kind of message, not just emails
● type: notification, comment, email
● subtype: plain, html
● threaded design: parent_id
● email API
OpenERP Community, Customers and Partners summit 10 April 2012
16. mail.thread
● mixin class
– holds API methods !
– message_ids field disappeared
– temporary field for web-client widget display and GTK-client
compatibility
OpenERP Community, Customers and Partners summit 10 April 2012
17. mail.thread
● Thread management
OpenERP Community, Customers and Partners summit 10 April 2012
18. mail.thread
● Thread management
● Subscription management
OpenERP Community, Customers and Partners summit 10 April 2012
19. mail.thread
● Thread management
● Subscription management
● Notification and Wall management
OpenERP Community, Customers and Partners summit 10 April 2012
20. mail.subscription
● Models user subscriptions to records
– many2many-like: user_id, res_model, res_id
OpenERP Community, Customers and Partners summit 10 April 2012
21. mail.subscription
● Automatic subscription
– when creating/updating a record
– when posting a comment
● Manual subscription
– Follow / unfollow buttons
– Invite button
OpenERP Community, Customers and Partners summit 10 April 2012
22. mail.subscription
● Subscription API in mail.thread
OpenERP Community, Customers and Partners summit 10 April 2012
23. mail.notification
● Models notifications pushed to users to display the Wall
– many2many: user_id, message_id
● Push
– user follows a record
– user is requested in message body (@login)
– user is requested to perform an action (ir.needaction)
OpenERP Community, Customers and Partners summit 10 April 2012
24. Outline
● Introduction
● What is OpenChatter ?
● Internals and API
● Thread widget and Wall
● Share and invite
● Need action mechanism
● How to use OpenChatter in my addon ?
● Work in progess
● Conclusion
OpenERP Community, Customers and Partners summit 10 April 2012
25. Thread widget
● Everything contained in mail addon
→ nice example of the new web client possibilities !
● Thread widget: handles the display of a thread of
messages
OpenERP Community, Customers and Partners summit 10 April 2012
26. Thread widget
● Everything contained in mail addon
→ nice example of the new web client possibilities !
● Thread widget: handles the display of a thread of
messages
● ThreadView widget: handles the display of OpenChatter
on a document
– messages thread
– actions
– followers
OpenERP Community, Customers and Partners summit 10 April 2012
27. Feeds page: Wall
● Client action, calling the Wall widget
● Shows recent threads
● Manage threads
– hide: delete notification
– delete: delete message if owner
– start a discussion
– reply: add a reply to the thread
OpenERP Community, Customers and Partners summit 10 April 2012
28. Outline
● Introduction
● What is OpenChatter ?
● Internals and API
● Thread widget and Wall
● Share and invite
● Need action mechanism
● How to use OpenChatter in my addon ?
● Work in progess
● Conclusion
OpenERP Community, Customers and Partners summit 10 April 2012
29. Share and invite
● Share extends mail.thread
→ add an Invite button and a new feature to OpenChatter
● Invite mechanism based on share
– simplified process, only give emails
– creates shared users if email not in database
– subscribes users to document
– pushes notifications
OpenERP Community, Customers and Partners summit 10 April 2012
30. Outline
● Introduction
● What is OpenChatter ?
● Internals and API
● Thread widget and Wall
● Share and invite
● Need action mechanism
● How to use OpenChatter in my addon ?
● Work in progess
● Conclusion
OpenERP Community, Customers and Partners summit 10 April 2012
31. Need action mechanism
● Ex: hr_holidays waiting validation
– notify manager
– counters in menu
OpenERP Community, Customers and Partners summit 10 April 2012
32. Need action mechanism
● Ex: hr_holidays waiting validation
– notify manager
– counters in menu
● ir.needaction_mixin
user_id res_model res_id
● update record
OpenERP Community, Customers and Partners summit 10 April 2012
33. Need action mechanism
● Ex: hr_holidays waiting validation
– notify manager
– counters in menu
● ir.needaction
user_id res_model res_id
● update record
● get_needaction_user_ids
OpenERP Community, Customers and Partners summit 10 April 2012
34. Need action mechanism
● Ex: hr_holidays waiting validation
– notify manager
– counters in menu
● ir.needaction
User Document
user_id res_model res_id
● update record
● get_needaction_user_ids
● update table
OpenERP Community, Customers and Partners summit 10 April 2012
35. Outline
● Introduction
● What is OpenChatter ?
● Internals and API
● Thread widget and Wall
● Share and invite
● Need action mechanism
● How to use OpenChatter in my addon ?
● Work in progess
● Conclusion
OpenERP Community, Customers and Partners summit 10 April 2012
36. Howto: use OpenChatter in my addon
● Easy as adding 2 lines of code !
OpenERP Community, Customers and Partners summit 10 April 2012
37. Howto: use OpenChatter in my addon
● System notification: self.message_append_note
– calls message_append that handles message data
– calls message_create that
● creates the message
● parses the body to find @login
● pushes to users following the document
OpenERP Community, Customers and Partners summit 10 April 2012
38. Howto: subscription management
● Ex: project manager should follow all its tasks
● Avoid doing it manually: override message_get_subscribers !
OpenERP Community, Customers and Partners summit 10 April 2012
39. Howto: subscription management
● Ex: project manager should follow all its tasks
● Avoid doing it manually: override message_get_subscribers !
● Pro:
– small code addition to project.task
– changing the project manager automatically update the followers
● Con:
– project manager cannot unfollow its tasks …
– but he can hide notifications if necessary
OpenERP Community, Customers and Partners summit 10 April 2012
40. Howto: control displayed messages
● ex: res.users OpenChatter should show
– messages related to this user (res.users, user_id)
– messages pushed to this user (contains @login)
● Override message_load !
OpenERP Community, Customers and Partners summit 10 April 2012
41. Howto: notifications guidelines
● Avoid unnecessary content
– short sentences
– do not include record name
● User simple and clean style
– html tags supported → b, em
– Main word(s) in bold
● Easily include of someone in discussion: @login
OpenERP Community, Customers and Partners summit 10 April 2012
42. Outline
● Introduction
● What is OpenChatter ?
● Internals and API
● Thread widget and Wall
● Share and invite
● Need action mechanism
● How to use OpenChatter in my addon ?
● Work in progess
● Conclusion
OpenERP Community, Customers and Partners summit 10 April 2012
43. New features
● Attachments
– keep attachments linked to records
– add a link from a comment to an
attachment
OpenERP Community, Customers and Partners summit 10 April 2012
44. New features
● Attachments
● Checklists
– embed checklists in comments
– on-the-fly creation and edition
– checks directly in comments
– see progression
OpenERP Community, Customers and Partners summit 10 April 2012
45. New features
● Attachments
● Checklists
● Voting system
● Custom name_get for integrating in kanban views
● Polling new messages on the Wall
OpenERP Community, Customers and Partners summit 10 April 2012
46. New features
● Open to remarks and suggestions !
● Open topics
– what do you need to see on the Wall ?
– sort notifications ?
– how to follow all sale orders ?
– action center ?
– ...
OpenERP Community, Customers and Partners summit 10 April 2012
47. Outline
● Introduction
● What is OpenChatter ?
● Internals and API
● The Wall
● Share and invite
● Need action mechanism
● How to use OpenChatter in my addon ?
● Work in progess
● Conclusion
OpenERP Community, Customers and Partners summit 10 April 2012
48. Conclusion
● Social not only a Buzzword !
● Still a long way to a good use of social features in companies
● OpenChatter
– centralizes notifications, comments and emails
– Feeds main page
– invite mechanism based on share
– integration with the mail gateway
– easy integration in addons !
OpenERP Community, Customers and Partners summit 10 April 2012
49. Conclusion
Thank you for your attention !
OpenERP Community, Customers and Partners summit 10 April 2012