A Guide to Posting Messages in Odoo18 Chatter
post chatter in odoo18 is an important component for ensuring communication and sharing information about the processes. It eases communication and collaboration in general.
For instance, in this odoo18 version, the chatter is also found in many modules such as Sales, Projects, Tasks, Invoicing, and so on where it assists in smooth communication and informs users about what is going on. In the image below, you can view the process details through the chatter.
Chat transcript display
The chat transcripts display the fact that the sales order for the order, the sales order confirmation, and the sales representative who confirmed the order were all completed order activities as well as the activity generated for the用户. When you need to notify the users about changes in your organization directly to the post chatter in odoo18 in certain situations like automating workflows, it is important to have a way to do so case in point, it allows you to send messages simply by clicking on the send button. Chatter can be in Odoo by setting up pre-coded messages and defining conditions to trigger these messages. This enhances the efficiency of information exchange by providing notifications succinctly without any manual intervention.
For instance, we build a student. student model to record a student and the student’s course status such as (a draft, a in_progress and or a completed one). When a user clicks the “Start Course” or “Complete Course” button, the model first updates the course status after which it goes ahead and posts a message on the chatter page notifying the other users of the change.
start_course method
Set the course status to progress, and notify that the course has started
The course method
updates the status to completed and sends a notification indicating that the course
This customization ensures that every time the course status changes, a message in the chatter, keeping everyone updated.
As seen, we added a function that allows to post a message in the corresponding student with the help of self.message_post(body=body), where ‘self’ means a student object. The content of the message in the body attribute which describes the message that is going to and displayed. The parameters of the message_post() method are below.
Parameters
⦁ body: The body parameter (str | Markup) represents the content of the message.If it is a string, If HTML content included, a Markup object should
⦁ message_type: value by the system from the mail. message.type field.
⦁ parent_id: It contains the parent partners that are in a message as a reply to another message when it is a private conversation.
⦁ attachments: This includes a list of tuples representing attachments in the form of (name, content) where content is not base64 encoded.
⦁ body_is_html: This parameter specifies whether the body must as HTML, regardless if it’s a string instead.
⦁ **kwargs: Any synonyms supplements the new mail.message record with the default values of the columns in the newly formed record.
⦁ email_from: Author’s email address is specified.
The result of the above example code is as below:
This is how we can efficiently add a message to the buzz. Now, let us look into the changes that can in the appearance of messages in Odoo18.
If a student in the body of the message for example, we can make the name a link that will take you to the particular student’s record. To do this add _get_html_link() method. Also, through the message_post() method, we can tag on the author as a means of identifying the sender of the message, change the format of the message and write its subject. The code to achieve this is as follows.
The result of the above code is as follows.
Conclusion
At this stage, we can see the end user, the message we composed, and the subject according to the template we provided.
There isn’t any limitation pertaining to the chatter-related any record and this feature Also, allows us the option of changing the content in order to make the message more appropriate for our desires and preferences or suit our needs.
To conclude, this article shows how you can send post chatter in odoo18 in an uncomplicated manner.
Send us your queries to learn more about Odoo Customization Services in Saudi Arabia.
"Unlock the Full Potential of Your Business with Odoo ERP!"
"Get a Cost Estimate for Your ERP Project, Absolutely FREE!"
Get a Free Quote