Skip to content

Commit

Permalink
Merge 8adcfb1 into 6c866eb
Browse files Browse the repository at this point in the history
  • Loading branch information
andhit-r authored Dec 19, 2018
2 parents 6c866eb + 8adcfb1 commit 7f37445
Show file tree
Hide file tree
Showing 14 changed files with 243 additions and 0 deletions.
39 changes: 39 additions & 0 deletions hr_employee_lau3_from_home_address/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

==================================================
Employee LAU Level 3 Information From Home Address
==================================================



Installation
============

To install this module, you need to:

1. Clone the branch 8.0 of the repository https://github.com/open-synergy/opnsynid-hr
2. Add the path to this repository in your configuration (addons-path)
3. Update the module list
4. Go to menu *Setting -> Modules -> Local Modules*
5. Search For *Employee LAU Level 3 Information From Home Address*
6. Install the module

Credits
=======

Contributors
------------

* Michael Viriyananda <viriyananda.michael@gmail.com>
* Andhitia Rama <andhitia.r@gmail.com>

Maintainer
----------

.. image:: https://opensynergy-indonesia.com/logo.png
:alt: OpenSynergy Indonesia
:target: https://opensynergy-indonesia.com

This module is maintained by the OpenSynergy Indonesia.
5 changes: 5 additions & 0 deletions hr_employee_lau3_from_home_address/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
20 changes: 20 additions & 0 deletions hr_employee_lau3_from_home_address/__openerp__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# pylint: disable=locally-disabled, manifest-required-author
{
"name": "Employee LAU Level 3 Information From Home Address",
"version": "8.0.1.0.0",
"category": "Human Resource",
"website": "https://opensynergy-indonesia.com",
"author": "OpenSynergy Indonesia",
"license": "AGPL-3",
"installable": True,
"depends": [
"hr_employee_lau_from_home_address",
"base_location_lau_level3",
],
"data": [
"views/hr_employee_views.xml",
],
}
5 changes: 5 additions & 0 deletions hr_employee_lau3_from_home_address/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import hr_employee
26 changes: 26 additions & 0 deletions hr_employee_lau3_from_home_address/models/hr_employee.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp import models, fields, api


class HrEmployee(models.Model):
_inherit = "hr.employee"

home_lau3_id = fields.Many2one(
string="Local Admin. Unit 3",
comodel_name="res.partner.lau",
domain=[
("level", "=", 3),
],
related="address_home_id.lau3_id",
)

@api.multi
@api.onchange("lau2_id")
def onchange_home_lau3(self):
for employee in self:
if employee.home_lau3_id and \
employee.home_lau3_id.parent_id != employee.home_lau2_id:
employee.home_lau3_id = False
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions hr_employee_lau3_from_home_address/views/hr_employee_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2018 OpenSynergy Indonesia
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->

<openerp>
<data>

<record id="hr_employee_view_form" model="ir.ui.view">
<field name="name">hr.employee form</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr_employee_lau_from_home_address.hr_employee_view_form"/>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='home_lau2_id']" position="after">
<field name="home_lau3_id"/>
</xpath>
</data>
</field>
</record>

</data>
</openerp>
39 changes: 39 additions & 0 deletions hr_employee_lau_from_home_address/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

==========================================
Employee LAU Information From Home Address
==========================================



Installation
============

To install this module, you need to:

1. Clone the branch 8.0 of the repository https://github.com/open-synergy/opnsynid-hr
2. Add the path to this repository in your configuration (addons-path)
3. Update the module list
4. Go to menu *Setting -> Modules -> Local Modules*
5. Search For *Employee LAU Information From Home Address*
6. Install the module

Credits
=======

Contributors
------------

* Michael Viriyananda <viriyananda.michael@gmail.com>
* Andhitia Rama <andhitia.r@gmail.com>

Maintainer
----------

.. image:: https://opensynergy-indonesia.com/logo.png
:alt: OpenSynergy Indonesia
:target: https://opensynergy-indonesia.com

This module is maintained by the OpenSynergy Indonesia.
5 changes: 5 additions & 0 deletions hr_employee_lau_from_home_address/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
20 changes: 20 additions & 0 deletions hr_employee_lau_from_home_address/__openerp__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# pylint: disable=locally-disabled, manifest-required-author
{
"name": "Employee LAU Information From Home Address",
"version": "8.0.1.0.0",
"category": "Human Resource",
"website": "https://opensynergy-indonesia.com",
"author": "OpenSynergy Indonesia",
"license": "AGPL-3",
"installable": True,
"depends": [
"hr_employee_data_from_home_address",
"base_location_lau",
],
"data": [
"views/hr_employee_views.xml",
],
}
5 changes: 5 additions & 0 deletions hr_employee_lau_from_home_address/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import hr_employee
34 changes: 34 additions & 0 deletions hr_employee_lau_from_home_address/models/hr_employee.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp import models, fields, api


class HrEmployee(models.Model):
_inherit = "hr.employee"

home_lau1_id = fields.Many2one(
string="Local Admin. Unit 1",
comodel_name="res.partner.lau",
domain=[
("level", "=", 1),
],
related="address_home_id.lau1_id",
)
home_lau2_id = fields.Many2one(
string="Local Admin. Unit 2",
comodel_name="res.partner.lau",
domain=[
("level", "=", 2),
],
related="address_home_id.lau2_id",
)

@api.multi
@api.onchange("lau1_id")
def onchange_home_lau2(self):
for employee in self:
if employee.home_lau2_id and \
employee.home_lau2_id.parent_id != employee.home_lau1_id:
employee.home_lau2_id = False
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions hr_employee_lau_from_home_address/views/hr_employee_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2018 OpenSynergy Indonesia
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->

<openerp>
<data>

<record id="hr_employee_view_form" model="ir.ui.view">
<field name="name">hr.employee form</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr_employee_data_from_home_address.hr_employee_view_form"/>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='home_phone']" position="before">
<field name="home_lau1_id"/>
<field name="home_lau2_id"/>
</xpath>
</data>
</field>
</record>

</data>
</openerp>

0 comments on commit 7f37445

Please sign in to comment.