mirror of
https://github.com/bringout/oca-payroll.git
synced 2026-04-19 06:21:58 +02:00
Initial commit: OCA Payroll packages (5 packages)
This commit is contained in:
commit
d19274f581
407 changed files with 214057 additions and 0 deletions
|
|
@ -0,0 +1,3 @@
|
|||
from . import ir_attachment_payroll_custom
|
||||
from . import ir_attachment
|
||||
from . import hr_employee
|
||||
|
|
@ -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
|
||||
|
|
@ -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,
|
||||
)
|
||||
|
|
@ -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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue