mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-24 11:32:00 +02:00
Initial commit: Core packages
This commit is contained in:
commit
12c29a983b
9512 changed files with 8379910 additions and 0 deletions
16
odoo-bringout-oca-ocb-survey/survey/models/badge.py
Normal file
16
odoo-bringout-oca-ocb-survey/survey/models/badge.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class GamificationBadge(models.Model):
|
||||
_inherit = 'gamification.badge'
|
||||
|
||||
survey_ids = fields.One2many('survey.survey', 'certification_badge_id', 'Survey Ids')
|
||||
survey_id = fields.Many2one('survey.survey', 'Survey', compute='_compute_survey_id', store=True)
|
||||
|
||||
@api.depends('survey_ids.certification_badge_id')
|
||||
def _compute_survey_id(self):
|
||||
for badge in self:
|
||||
badge.survey_id = badge.survey_ids[0] if badge.survey_ids else None
|
||||
Loading…
Add table
Add a link
Reference in a new issue