all clases that inherits ‘mail.thread’ on record creation will display a message in the chatter log
class Project(models.Model):
_name = "project.project"
_description = "Project"
_inherit = ['portal.mixin', 'mail.alias.mixin', 'mail.thread', 'mail.activity.mixin', 'rating.parent.mixin']
_order = "sequence, name, id"
_rating_satisfaction_days = False # takes all existing ratings
_check_company_auto = True
To be able to modify this message must override the _creation_message function
class Project(models.Model):
_name = "project.project"
_description = "Project"
_inherit = ['portal.mixin', 'mail.alias.mixin', 'mail.thread', 'mail.activity.mixin', 'rating.parent.mixin']
_order = "sequence, name, id"
_rating_satisfaction_days = False # takes all existing ratings
_check_company_auto = True
def _creation_message(self):
""" Get the creation message to log into the chatter at the record's creation.
:returns: The message's body to log.
"""
self.ensure_one()
doc_name = "Hello world"
return _('%s created', doc_name)