19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:31:00 +01:00
parent a1137a1456
commit e1d89e11e3
2789 changed files with 1093187 additions and 605897 deletions

View file

@ -0,0 +1,33 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
from odoo.tools import email_normalize
class HrJobPlatform(models.Model):
_name = 'hr.job.platform'
_description = 'Job Platforms'
name = fields.Char(required=True)
email = fields.Char(required=True, help="Applications received from this Email won't be linked to a contact."
"There will be no email address set on the Applicant either.")
regex = fields.Char(help="The regex facilitates to extract information from the subject or body "
"of the received email to autopopulate the Applicant's name field")
_email_uniq = models.Constraint(
'unique (email)',
'The Email must be unique, this one already corresponds to another Job Platform.',
)
@api.model_create_multi
def create(self, vals_list):
for vals in vals_list:
if vals['email']:
vals['email'] = email_normalize(vals['email']) or vals['email']
platforms = super().create(vals_list)
return platforms
def write(self, vals):
if vals.get('email'):
vals['email'] = email_normalize(vals['email']) or vals['email']
return super().write(vals)