Initial commit: OCA Technical packages (595 packages)

This commit is contained in:
Ernad Husremovic 2025-08-29 15:43:03 +02:00
commit 2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions

View file

@ -0,0 +1,2 @@
from . import hr_job
from . import hr_contract

View file

@ -0,0 +1,12 @@
from odoo import models
class HrContract(models.Model):
_inherit = "hr.contract"
def write(self, vals):
res = super().write(vals)
if "state" in vals:
job_obj = self.job_id
job_obj._compute_to_recruit()
return res

View file

@ -0,0 +1,21 @@
from odoo import api, fields, models
class HrJob(models.Model):
_inherit = "hr.job"
@api.depends("no_of_recruitment")
def _compute_to_recruit(self):
contract_obj = self.env["hr.contract"]
for rec in self:
rec.to_recruit = rec.no_of_recruitment - contract_obj.search_count(
[("job_id", "=", rec.id), ("state", "=", "open")]
)
if rec.to_recruit > 0:
rec.website_published = True
else:
rec.website_published = False
to_recruit = fields.Integer(
string="To be recruited", compute="_compute_to_recruit", store=True
)