mirror of
https://github.com/bringout/oca-technical.git
synced 2026-04-18 19:12:03 +02:00
Initial commit: OCA Technical packages (595 packages)
This commit is contained in:
commit
2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions
45
odoo-bringout-oca-hack-payroll/payroll/models/hr_contract.py
Normal file
45
odoo-bringout-oca-hack-payroll/payroll/models/hr_contract.py
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class HrContract(models.Model):
|
||||
"""
|
||||
Employee contract based on the visa, work permits
|
||||
allows to configure different Salary structure
|
||||
"""
|
||||
|
||||
_inherit = "hr.contract"
|
||||
_description = "Employee Contract"
|
||||
|
||||
struct_id = fields.Many2one("hr.payroll.structure", string="Salary Structure")
|
||||
schedule_pay = fields.Selection(
|
||||
[
|
||||
("monthly", "Monthly"),
|
||||
("quarterly", "Quarterly"),
|
||||
("semi-annually", "Semi-annually"),
|
||||
("annually", "Annually"),
|
||||
("weekly", "Weekly"),
|
||||
("bi-weekly", "Bi-weekly"),
|
||||
("bi-monthly", "Bi-monthly"),
|
||||
],
|
||||
string="Scheduled Pay",
|
||||
index=True,
|
||||
default="monthly",
|
||||
help="Defines the frequency of the wage payment.",
|
||||
)
|
||||
resource_calendar_id = fields.Many2one(
|
||||
required=True, help="Employee's working schedule."
|
||||
)
|
||||
|
||||
def get_all_structures(self):
|
||||
"""
|
||||
@return: the structures linked to the given contracts, ordered by
|
||||
hierachy (parent=False first, then first level children and
|
||||
so on) and without duplicates
|
||||
"""
|
||||
structures = self.mapped("struct_id")
|
||||
if not structures:
|
||||
return []
|
||||
# YTI TODO return browse records
|
||||
return list(set(structures._get_parent_structure().ids))
|
||||
Loading…
Add table
Add a link
Reference in a new issue