chore: import enterprise addons 19.0 bulk snapshot

This commit is contained in:
1b-agent committed 2026-09-16 10:13:08 +00:00
commit ca4af030d3
39951 files changed
+15570005

No files matched your search

@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
from . import hr_version
from . import res_company
from . import res_config_settings
@@ -0,0 +1,22 @@
from odoo import fields, models, _
class HrVersion(models.Model):
_inherit = 'hr.version'
leave_allocation_id = fields.Many2one('hr.leave.allocation', 'Allocation', readonly=True, groups="hr.group_hr_user", tracking=True)
def write(self, vals):
res = super().write(vals)
if 'state' in vals and vals['state'] == 'cancel':
for record in self.filtered(lambda r: r.leave_allocation_id and r.leave_allocation_id.state != 'refuse'):
record.leave_allocation_id.write({'state': 'refuse'})
record.leave_allocation_id.message_post(
body=_('Contract has been cancelled.'),
)
return res
def action_list_leaves(self):
action = self.env["ir.actions.actions"]._for_xml_id("hr_holidays.hr_leave_allocation_action_all")
action['context'] = {'search_default_employee_id': self.employee_id.id}
return action
@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
from odoo.exceptions import ValidationError
class ResCompany(models.Model):
_inherit = 'res.company'
hr_contract_timeoff_auto_allocation = fields.Boolean(string="Extra Time Off Allocation on contract signature")
hr_contract_timeoff_auto_allocation_type_id = fields.Many2one(
'hr.leave.type', string="Time Off Type", domain=[('requires_allocation', '=', True)])
_auto_allocation = models.Constraint(
"CHECK(hr_contract_timeoff_auto_allocation = 'f' OR hr_contract_timeoff_auto_allocation_type_id IS NOT NULL)",
"A Time Off Type is required once the Extra Time Off automatic allocation is set.",
)
@@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-
import threading
from odoo import fields, models
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
hr_contract_timeoff_auto_allocation = fields.Boolean(related="company_id.hr_contract_timeoff_auto_allocation", readonly=False)
hr_contract_timeoff_auto_allocation_type_id = fields.Many2one(
'hr.leave.type', related='company_id.hr_contract_timeoff_auto_allocation_type_id', readonly=False)