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

Module: Discuss

Entity: mail.poll.option

Compute Method: _compute_number_of_votes

View 20.0
Inputs Method Outputs
+ count_by_option = dict(
+             self.env["mail.poll.vote"]._read_group(
+                 [("option_id", "in", self.ids)], ["option_id"], ["__count"]
+             )
+         )
+ for option in self:
+             option.number_of_votes = count_by_option.get(option, 0)
  • number_of_votes

Back to entity