mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-23 10:32:06 +02:00
Initial commit: Core packages
This commit is contained in:
commit
12c29a983b
9512 changed files with 8379910 additions and 0 deletions
22
odoo-bringout-oca-ocb-event/event/models/res_partner.py
Normal file
22
odoo-bringout-oca-ocb-event/event/models/res_partner.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResPartner(models.Model):
|
||||
_inherit = 'res.partner'
|
||||
|
||||
event_count = fields.Integer(
|
||||
'# Events', compute='_compute_event_count', groups='event.group_event_registration_desk')
|
||||
|
||||
def _compute_event_count(self):
|
||||
self.event_count = 0
|
||||
for partner in self:
|
||||
partner.event_count = self.env['event.event'].search_count([('registration_ids.partner_id', 'child_of', partner.ids)])
|
||||
|
||||
def action_event_view(self):
|
||||
action = self.env["ir.actions.actions"]._for_xml_id("event.action_event_view")
|
||||
action['context'] = {}
|
||||
action['domain'] = [('registration_ids.partner_id', 'child_of', self.ids)]
|
||||
return action
|
||||
Loading…
Add table
Add a link
Reference in a new issue