Skip to content

Commit

Permalink
Merge d96a354 into 901a545
Browse files Browse the repository at this point in the history
  • Loading branch information
andhit-r committed Oct 25, 2018
2 parents 901a545 + d96a354 commit 9a06635
Show file tree
Hide file tree
Showing 10 changed files with 189 additions and 0 deletions.
39 changes: 39 additions & 0 deletions hr_department_type/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

================================
Human Resource - Department Type
================================

This module adds a type for Department.

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

To install this module, you need to:

1. Clone the branch 10.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 *Human Resource - Department Type*
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_department_type/__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
21 changes: 21 additions & 0 deletions hr_department_type/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- 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": "Human Resource - Department Type",
"version": "10.0.1.0.0",
"category": "Human Resource",
"website": "https://opensynergy-indonesia.com",
"author": "OpenSynergy Indonesia",
"license": "AGPL-3",
"installable": True,
"depends": [
"hr"
],
"data": [
"security/ir.model.access.csv",
"views/hr_department_type_views.xml",
"views/hr_department_views.xml"
],
}
8 changes: 8 additions & 0 deletions hr_department_type/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

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

from odoo import models, fields


class HrDepartment(models.Model):
_inherit = "hr.department"

department_type_id = fields.Many2one(
string="Department Type",
comodel_name="hr.department.type"
)
21 changes: 21 additions & 0 deletions hr_department_type/models/hr_department_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import models, fields


class HrDepartmentType(models.Model):
_name = "hr.department.type"

name = fields.Char(
string="Name",
required=True
)
description = fields.Text(
string="Description"
)
active = fields.Boolean(
string="Active",
default=True
)
3 changes: 3 additions & 0 deletions hr_department_type/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_hr_department_type_all_user,Department Type All User ,model_hr_department_type,,1,0,0,0
access_hr_department_type_employee,Department Type Employee,model_hr_department_type,base.group_user,1,1,1,1
Binary file added hr_department_type/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions hr_department_type/views/hr_department_type_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2018 OpenSynergy Indonesia
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->

<odoo>
<record id="hr_department_type_view_tree" model="ir.ui.view">
<field name="name">Tree Hr Department Type</field>
<field name="model">hr.department.type</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="description"/>
<field name="active"/>
</tree>
</field>
</record>

<record id="hr_department_type_view_form" model="ir.ui.view">
<field name="name">Form Hr Department Type</field>
<field name="model">hr.department.type</field>
<field name="arch" type="xml">
<form string="Department Type">
<sheet>
<group col="4">
<field name="name"/>
<field name="active"/>
<field name="description"/>
</group>
</sheet>
</form>
</field>
</record>

<record id="hr_department_type_action" model="ir.actions.act_window">
<field name="name">Department Type</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">hr.department.type</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to add a Department Type.
</p>
</field>
</record>

<menuitem
id="hr_department_type_menu"
name="Department Type"
parent="hr.menu_human_resources_configuration"
action="hr_department_type_action"
sequence="6"
/>
</odoo>
24 changes: 24 additions & 0 deletions hr_department_type/views/hr_department_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="hr_department_view_tree" model="ir.ui.view">
<field name="name">Inherit HR Department Tree</field>
<field name="model">hr.department</field>
<field name="inherit_id" ref="hr.view_department_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='manager_id']" position="after">
<field name="department_type_id" />
</xpath>
</field>
</record>

<record id="hr_department_view_form" model="ir.ui.view">
<field name="name">Inherit HR Department Form</field>
<field name="model">hr.department</field>
<field name="inherit_id" ref="hr.view_department_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='parent_id']" position="after">
<field name="department_type_id" />
</xpath>
</field>
</record>
</odoo>

0 comments on commit 9a06635

Please sign in to comment.