Initial commit: OCA Payroll packages (5 packages)

This commit is contained in:
Ernad Husremovic 2025-08-29 15:43:05 +02:00
commit d19274f581
407 changed files with 214057 additions and 0 deletions

View file

@ -0,0 +1,3 @@
from . import ir_attachment_payroll_custom
from . import ir_attachment
from . import hr_employee

View file

@ -0,0 +1,14 @@
from odoo import _, models
from odoo.exceptions import ValidationError
class Employee(models.Model):
_inherit = "hr.employee"
def write(self, vals):
res = super().write(vals)
if "identification_id" in vals and not self.env["res.partner"].simple_vat_check(
self.env.company.country_id.code, vals["identification_id"]
):
raise ValidationError(_("The field identification ID is not valid"))
return res

View file

@ -0,0 +1,14 @@
from odoo import fields, models
class Attachment(models.Model):
_inherit = "ir.attachment"
payrol_rel = fields.Many2many(
"payroll.management.wizard",
"payrolls",
"attachment_id3",
"document_id",
string="Attachment",
invisible=1,
)

View file

@ -0,0 +1,18 @@
from odoo import fields, models
class IRAttachmentPayrollCustom(models.Model):
_name = "ir.attachment.payroll.custom"
_description = "Payroll attachment"
attachment_id = fields.Many2one(
comodel_name="ir.attachment",
string="Attachment File",
prefetch=False,
invisible=True,
ondelete="cascade",
)
employee = fields.Char()
identification_id = fields.Char("Identification ID")
create_date = fields.Date(default=fields.Date.context_today)
subject = fields.Char()