Initial commit: Core packages

This commit is contained in:
Ernad Husremovic 2025-08-29 15:20:45 +02:00
commit 12c29a983b
9512 changed files with 8379910 additions and 0 deletions

View 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