mirror of
https://github.com/bringout/oca-ocb-hr.git
synced 2026-04-27 03:12:05 +02:00
Initial commit: Hr packages
This commit is contained in:
commit
62531cd146
2820 changed files with 1432848 additions and 0 deletions
|
|
@ -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
|
||||
))
|
||||
Loading…
Add table
Add a link
Reference in a new issue