Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
4328 Widoki

when 1st time the data is created, in the chatter section it is showing 


Mitchell Admin- 2 hours ago

    asset.asset_category created


Instead of " asset.asset_category created",   I want to show "Asset Category: Name"

asset_category model is:-
classAssetCategory(models.Model):
     """ This class used for the Asset Category data model. """
_name = 'asset.asset_category'
     _description = 'asset.asset_category'
     _inherit = ['portal.mixin', 'mail.thread', 'mail.activity.mixin']
description = fields.Text(string="Description", track_visibility='onchange')
     name = fields.Char(string="Name", required=True, track_visibility='onchange')
.test..
Awatar
Odrzuć
Najlepsza odpowiedź

Hi Ashutosh, 

Basically on creation of every records with chatter functionality, the first log will be the record creation message. It will always takes the name of the model (which we configure in the _description of the model/class).

In your case, your model name (description) is 'asset.asset_category', so the record creation message will be 'asset.asset_category created'.  If you change model name to 'Asset Category' then it will create the message like :

    ' Asset Category Created' 

Now to fulfil your requirement, you just need inherit and change the "_creation_message" method for your model and return the value you want for particularly your model or for all model.

I hope it will help you...

Awatar
Odrzuć
Autor

Thank you so much Malay

Powiązane posty Odpowiedzi Widoki Czynność
0
wrz 22
1850
2
mar 24
5612
1
maj 25
4433
2
lis 24
3873
1
kwi 24
1267