By default, Odoo Chatter displays changes made in char, float, bool, Many2one fields. Let’s say if a user changes customer name it would be logged in the chatter.
Using tracking attributes on One2many fields for traceability, a user can’t track the changes, and thereby, chatter won’t display the logs created or updated manually or using a file.
But there are scenarios wherein an organization also requires tracking of One2many fields.
Here’s how the customization works.
Custom Odoo Chatter Flow:
Let’s consider the sale price list item, it is one2many of the sale price lists. In order to keep its track in Odoo Chatter, we used the message_post method of mail.message in pricelist_item_line to post a message in the chatter of product_pricelist.
Post its implementation, if a user manually creates new line, a log is displayed in chatter with created message and values.
As the lines are updated in One2many, a message is pushed in the chatter with the old values in reference to new values. This will help a user to get track changes made in any of the One2many fields meticulously.
Now, the main challenge was to create or update the Chatter log data when a user tries to import pricelist changes in Odoo from a file.
As we have used post.message method to track One2many fields, Odoo Chatter will create a separate log for each update. E.g., if a user imports a file with 100 lines of sales price list items the chatter will update 100 values separately which might become clumsy to refer.
Therefore, we have managed the import updates in single log with a message that the data is created using this file (file name). We have also made it possible to keep an attachment file while importing data.
Note: We used our custom import functionality to replace Odoo’s import-export feature.
If you require further information regarding pricelist updates in Odoo Chatter, contact our functional experts. We would love to onboard any customization requests regarding the chatter or any of the Odoo modules/features. All you need to do is drop your requirements here, and we will get it done for you.