Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Live Chat

Entity: digest.digest

Compute Method: _compute_kpi_livechat_rating_value

Inputs Method Outputs
channels = self.env['discuss.channel'].search([('channel_type', '=', 'livechat')])
start, end, __ = self._get_kpi_compute_parameters()
domain = [
            ('create_date', '>=', start),
            ('create_date', '<', end),
        ]
ratings = channels.rating_get_grades(domain)
self.kpi_livechat_rating_value = (
            ratings['great'] * 100 / sum(ratings.values())
            if sum(ratings.values()) else 0
        )

Back to entity