Initial commit: Hr packages

This commit is contained in:
Ernad Husremovic 2025-08-29 15:20:50 +02:00
commit 62531cd146
2820 changed files with 1432848 additions and 0 deletions

View file

@ -0,0 +1,19 @@
# -*- coding:utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import _, api, models
from odoo.exceptions import UserError
class UtmCampaign(models.Model):
_inherit = 'utm.campaign'
@api.ondelete(at_uninstall=False)
def _unlink_except_utm_campaign_job(self):
utm_campaign_job = self.env.ref('hr_recruitment.utm_campaign_job', raise_if_not_found=False)
if utm_campaign_job and utm_campaign_job in self:
raise UserError(_(
"The UTM campaign '%s' cannot be deleted as it is used in the recruitment process.",
utm_campaign_job.name
))