Repository
odoo/odoo · module folder
Module version
1.1
Category
Productivity
Folder size
1.49 MB
License
LGPL-3
Application
No
Auto-installable
No
Website
None
Last tracking update
2026-08-15 22:44:14
Authors
Odoo S.A.
Maintainers
Odoo S.A.
Committers
Raphael Collet, Thibault Delavallée, Odoo Translation Bot, Alexandre Kühn, Julien Castiaux, Victor Feyens, Sébastien Theys, Tiffany Chang (tic), Gorash, Mathieu Duckerts-Antoine, tsm-odoo, Victor Piryns (pivi), Dylan Kiss (dyki), maad-odoo, Maryam Kia, jorv-odoo, Krzysztof Magusiak (krma), nees-odoo, Giorgio Tocco (gito), Kevin Gerard (kege), pmah-odoo, saurabh, Fanyang Meng (fame), ELCO
Odoo dependencies
odoo/odoo:
- web
- bus
Python dependencies
None
System dependencies
None
Required by
helpdesk_mgmt_rating, im_livechat, portal_rating, project, test_mail_full
Description
This module allows a customer to give rating.

Code Analysis

Views touched (12)
XML IDNameModelTypeStatus
mail_message_view_form mail.message.view.form.inherit.rating mail.message form Inherits mail.mail_message_view_form
rating_external_page_invalid_partner Not allows to rating ir.ui.view qweb New
rating_external_page_submit Rate our Services ir.ui.view qweb New
rating_external_page_view Thanks for your Feedback ir.ui.view qweb New
rating_rating_view_form rating.rating.form rating.rating form New
rating_rating_view_form_text rating.rating.view.form.text rating.rating form Inherits rating.rating_rating_view_form
rating_rating_view_graph rating.rating.graph rating.rating graph New
rating_rating_view_kanban rating.rating.kanban rating.rating kanban New
rating_rating_view_kanban_stars rating.rating.view.kanban.stars rating.rating kanban New
rating_rating_view_pivot rating.rating.pivot rating.rating pivot New
rating_rating_view_search rating.rating.search rating.rating search New
rating_rating_view_tree rating.rating.list rating.rating list New
HTTP endpoints (2)
Route(s)HandlerAuthTypeMethodsFlags
/rate/<string:token>/<int:rate> Rating.action_open_rating public http ALL website
/rate/<string:token>/submit_feedback Rating.action_submit_rating public http post, get website
Models touched (5)

New fields (3)
  • rating_id Many2one → rating.rating
    compute='_compute_rating_id' args: 'rating.rating'
  • rating_ids One2many → rating.rating
    string='Related ratings' args: 'rating.rating', 'message_id'
  • rating_value Float
    compute='_compute_rating_value' compute_sudo=True search='_search_rating_value' store=False args: 'Rating Value'
Public methods (0)

No public methods.

New fields (1)
  • rating_ids One2many → rating.rating
    bypass_search_access=True domain=<expr> groups='base.group_user' string='Ratings' args: 'rating.rating', 'res_id'
Public methods (4)
  • message_post(self, **kwargs)
  • rating_apply(self, rate, token=None, rating=None, feedback=None, subtype_xmlid=None, notify_delay_send=False)
    Apply a rating to the record. This rating can either be linked to a token (customer flow) or directly a rating record (code flow). If the current model inherits from mail.thread mixin a message is posted on its chatter. User going through this method should have at least employee rights as well as rights on the current record because of rating manipulation and chatter post (either employee, either sudo-ed in public controllers after security check granting access). :param float rate: the rating value to apply (from 0 to 5); :param string token: access token to fetch the rating to apply (optional); :param record rating: rating.rating to apply (if no token); :param string feedback: additional feedback (plaintext); :param string subtype_xmlid: xml id of a valid mail.message.subtype used to post the message (if it applies). If not given a classic comment is posted; :param notify_delay_send: Delay the sending by 2 hours of the email so the user can still change his feedback. If False, the email will be sent immediately. :returns: rating.rating record
  • rating_send_request(self, template, lang=False, force_send=True)
    This method send rating request by email, using a template given in parameter. :param record template: a mail.template record used to compute the message body; :param str lang: optional lang; it can also be specified directly on the template itself in the lang field; :param bool force_send: whether to send the request directly or use the mail queue cron (preferred option);
  • unlink(self)
    When removing a record, its rating should be deleted too.

New fields (8)
  • rating_avg Float
    compute='_compute_rating_stats' compute_sudo=True groups='base.group_user' search='_search_rating_avg' args: 'Average Rating'
  • rating_avg_text Selection
    compute='_compute_rating_avg_text' compute_sudo=True groups='base.group_user' args: rating_data.RATING_TEXT
  • rating_count Integer
    compute='_compute_rating_stats' compute_sudo=True args: 'Rating count'
  • rating_last_feedback Text
    groups='base.group_user' related='rating_ids.feedback' args: 'Rating Last Feedback'
  • rating_last_image Binary
    groups='base.group_user' related='rating_ids.rating_image' args: 'Rating Last Image'
  • rating_last_text Selection
    groups='base.group_user' related='rating_ids.rating_text' string='Rating Text'
  • rating_last_value Float
    aggregator='avg' compute='_compute_rating_last_value' compute_sudo=True groups='base.group_user' store=True args: 'Rating Last Value'
  • rating_percentage_satisfaction Float
    compute='_compute_rating_satisfaction' compute_sudo=True args: 'Rating Satisfaction'
Public methods (3)
  • rating_get_grades(self, domain=None)
    Get the repartitions of rating grade for the given res_ids. :param domain: Optional domain of the rating to include/exclude in the grades computation. :returns: A dictionary where the key is the rating and the value is the count of unique ``(res_model, res_id)`` pairs whose grades are associated with that rating. The rates are: * ``"great"``, graded between 70 and 100 * ``"okay"``, graded between 31 and 69 * ``"bad"``, graded between 0 and 30 :rtype: dict[typing.Literal["great", "okay", "bad"], int]
  • rating_get_stats(self, domain=None)
    Get the statistics of the rating repartitions :param domain : optional domain of the rating to include/exclude in statistic computation :returns: A dictionnary where: - key is the name of the information (stat name) - value is statistic value : 'percent' contains the repartition in percentage, 'avg' is the average rate and 'total' is the number of rating
  • write(self, vals)
    If the rated ressource name is modified, we should update the rating res_name too. If the rated ressource parent is changed we should update the parent_res_id too

New fields (5)
  • rating_avg Float
    compute='_compute_rating_percentage_satisfaction' compute_sudo=True groups='base.group_user' search='_search_rating_avg' args: 'Average Rating'
  • rating_avg_percentage Float
    compute='_compute_rating_percentage_satisfaction' compute_sudo=True groups='base.group_user' args: 'Average Rating (%)'
  • rating_count Integer
    compute='_compute_rating_percentage_satisfaction' compute_sudo=True string='# Ratings'
  • rating_ids One2many → rating.rating
    bypass_search_access=True domain=<expr> groups='base.group_user' string='Ratings' args: 'rating.rating', 'parent_res_id'
  • rating_percentage_satisfaction Integer
    compute='_compute_rating_percentage_satisfaction' compute_sudo=True help='Percentage of happy ratings' store=False args: 'Rating Satisfaction'
Public methods (0)

No public methods.

New fields (24)
  • access_token Char
    default=_default_access_token args: 'Security Token'
  • consumed Boolean
    string='Filled Rating'
  • create_date Datetime
    string='Submitted on'
  • feedback Text
    args: 'Comment'
  • is_internal Boolean
    readonly=False related='message_id.is_internal' store=True args: 'Visible Internally Only'
  • message_id Many2one → mail.message
    index=True ondelete='cascade' string='Message' args: 'mail.message'
  • parent_ref Reference
    compute='_compute_parent_ref' readonly=True selection='_selection_target_model' string='Parent Ref'
  • parent_res_id Integer
    index=True args: 'Parent Document'
  • parent_res_model Char
    index=True readonly=False related='parent_res_model_id.model' store=True args: 'Parent Document Model'
  • parent_res_model_id Many2one → ir.model
    index=True ondelete='cascade' args: 'ir.model', 'Parent Related Document Model'
  • parent_res_name Char
    compute='_compute_parent_res_name' store=True args: 'Parent Document Name'
  • partner_id Many2one → res.partner
    string='Customer' args: 'res.partner'
  • rated_on Datetime
    string='Rated On'
  • rated_partner_id Many2one → res.partner
    string='Rated Operator' args: 'res.partner'
  • rated_partner_name Char
    related='rated_partner_id.name'
  • rating Float
    aggregator='avg' default=0 string='Rating Value'
  • rating_image Binary
    compute='_compute_rating_image' args: 'Image'
  • rating_image_url Char
    compute='_compute_rating_image' args: 'Image URL'
  • rating_text Selection
    compute='_compute_rating_text' readonly=True store=True string='Rating' args: rating_data.RATING_TEXT
  • res_id Many2oneReference
    index=True model_field='res_model' required=True string='Document'
  • res_model Char
    index=True readonly=True related='res_model_id.model' store=True string='Document Model'
  • res_model_id Many2one → ir.model
    index=True ondelete='cascade' args: 'ir.model', 'Related Document Model'
  • res_name Char
    compute='_compute_res_name' store=True string='Resource name'
  • resource_ref Reference
    compute='_compute_resource_ref' readonly=True selection='_selection_target_model' string='Resource Ref'
Public methods (5)
  • action_open_rated_object(self)
  • create(self, vals_list)
    @api.model_create_multi
  • reset(self)
  • unlink(self)
  • write(self, vals)

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…