Commit c459bf54 authored by Santiago Apel's avatar Santiago Apel 💬
Browse files

Merge branch 'last_contract_id' into '12.0-stage'


See merge request !32
parents d554babc 2298ee1b
......@@ -33,6 +33,7 @@
......@@ -13,4 +13,5 @@ from . import safe_eval # noqa
from . import res_company # noqa
from . import hr_contract # noqa
from . import hr_payroll_structure # added struct_type field - 6-abr (dan)
from . import hr_payroll_structure_type # created struct_type model - 6-abr (dan)
\ No newline at end of file
from . import hr_payroll_structure_type # created struct_type model - 6-abr (dan)
from . import hr_employee
\ No newline at end of file
# -*- coding: utf-8 -*-
from odoo import api, fields, models
class HREmployee(models.Model):
_inherit = "hr.employee"
def _get_vigent_contract(self):
for record in self:
contract_ids = self.env["hr.contract"].search(
['&',("employee_id", "=",,('state','=','open')],
order="date_start desc",
if contract_ids:
contract_id = contract_ids[0]
record.last_contract_id =
record.last_contract_id = False
last_contract_id = fields.Many2one(
string="Vigent contract",
<record id="view_employee_form_inherit_lsd" model="ir.ui.view">
<field name="name">view.employee.form.inherit.lsd</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='other_id']" position="after">
<field name="last_contract_id"/>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment