[FIX] rating: allow rating deletion
Purpose of this commit is to
* delete rating when deleting message. Otherwise rating coming from
frontend portal review chatter are lost in the void;
* allow system users to delete ratings;
Task ID 2058595
PR #36281
This commit is contained in:
@@ -50,7 +50,10 @@ class Rating(models.Model):
|
||||
('highly_dissatisfied', 'Highly dissatisfied'),
|
||||
('no_rating', 'No Rating yet')], string='Rating', store=True, compute='_compute_rating_text', readonly=True)
|
||||
feedback = fields.Text('Comment', help="Reason of the rating")
|
||||
message_id = fields.Many2one('mail.message', string="Linked message", help="Associated message when posting a review. Mainly used in website addons.", index=True)
|
||||
message_id = fields.Many2one(
|
||||
'mail.message', string="Linked message",
|
||||
index=True, ondelete='cascade',
|
||||
help="Associated message when posting a review. Mainly used in website addons.")
|
||||
access_token = fields.Char('Security Token', default=_default_access_token, help="Access token to set the rating of the value")
|
||||
consumed = fields.Boolean(string="Filled Rating", help="Enabled if the rating has been filled.")
|
||||
|
||||
|
||||
@@ -2,3 +2,4 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_rating_user,rating.rating.user,rating.model_rating_rating,base.group_user,1,1,1,0
|
||||
access_rating_public,rating.rating.public,rating.model_rating_rating,base.group_public,1,1,1,0
|
||||
access_rating_portal,rating.rating.portal,rating.model_rating_rating,base.group_portal,1,1,1,0
|
||||
rating_rating_access_system,rating.rating.access.system,rating.model_rating_rating,base.group_system,1,1,1,1
|
||||
|
||||
|
Reference in New Issue
Block a user