[FIX] event: restrict event_count field on partner for event user only
Currently event_count is a computed field with a shortcut in computation for non event user. It is better to directly limit this field to the event_user group instead. LINKS Side effect of Task ID 2089156 (event onchange to compute) Community PR odoo/odoo#43127 Enterprise PR odoo/enterprise#7656
This commit is contained in:
@@ -3,10 +3,13 @@
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class ResPartner(models.Model):
|
||||
_inherit = 'res.partner'
|
||||
|
||||
event_count = fields.Integer("Events", compute='_compute_event_count', help="Number of events the partner has participated.")
|
||||
event_count = fields.Integer(
|
||||
'# Events', compute='_compute_event_count', groups='event.group_event_user',
|
||||
help='Number of events the partner has participated.')
|
||||
|
||||
def _compute_event_count(self):
|
||||
self.event_count = 0
|
||||
|
||||
Reference in New Issue
Block a user