diff options
| author | jem-odoo <jem@openerp.com> | 2019-01-30 16:24:55 +0000 |
|---|---|---|
| committer | jem-odoo <jem@openerp.com> | 2019-02-06 09:55:13 +0000 |
| commit | 8c840f7539c00bbc64c11b79a7d8124cb371b789 (patch) | |
| tree | 0b105c0c4d2d1670d1c06ddd3f1c6b828b29b7ef /doc/reference/javascript_reference.rst | |
| parent | 1ed3cb37b016e806a6381922eb331d7c4a0b004b (diff) | |
[IMP] rating: add rating average on mixin
This commit provides 1 more field on the rating mixin: the average of
the ratings of the document. Before that, the only way to get the
average was to call `rating_get_stats` record per record.
As we are on a mixin, this new field is not stored to avoid recomputation
each time a rating is added. To improve performance, we decided to
compute `rating_count` and `rating_avg` in one `read_group`.
This commit also set an extendable method to get the domain of the
rating to include in those statistics computation, called `_rating_domain`.
This way, each model inheriting the rating.mixin can define the subset of
pertinent ratings.
As consequence, this commit uniformized the way average is displayed:
instead of taking the closer value to the 0.5 value, it only round it
at 2 digits.
Task-1902304
Diffstat (limited to 'doc/reference/javascript_reference.rst')
0 files changed, 0 insertions, 0 deletions
