Skip to content

Commit

Permalink
Adding New Module hr_payslip_type
Browse files Browse the repository at this point in the history
Revision
  • Loading branch information
mikevhe18 committed Nov 17, 2017
1 parent 586c6c3 commit 08abe56
Show file tree
Hide file tree
Showing 12 changed files with 259 additions and 0 deletions.
39 changes: 39 additions & 0 deletions hr_payslip_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 - Payslip Type
=============================

This module adds a type for Payslip.

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 *Human Resource - Payslip Type*
6. Install the module

Credits
=======

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

* Andhitia Rama <andhitia.r@gmail.com>
* Michael Viriyananda <viriyananda.michael@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_payslip_type/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2017 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
22 changes: 22 additions & 0 deletions hr_payslip_type/__openerp__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# Copyright 2017 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Human Resource - Payslip Type",
"version": "8.0.1.0.0",
"category": "Human Resource",
"website": "https://opensynergy-indonesia.com",
"author": "OpenSynergy Indonesia",
"license": "AGPL-3",
"installable": True,
"depends": [
"hr_payroll"
],
"data": [
"security/ir.model.access.csv",
"data/hr_payslip_type_data.xml",
"views/hr_payslip_type_views.xml",
"views/hr_payslip_views.xml",
"views/hr_payslip_run_views.xml"
],
}
9 changes: 9 additions & 0 deletions hr_payslip_type/data/hr_payslip_type_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<record id="hr_payslip_type_normal" model="hr.payslip.type">
<field name="name">Normal</field>
<field name="active" eval="True"/>
</record>
</data>
</openerp>
9 changes: 9 additions & 0 deletions hr_payslip_type/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-
# Copyright 2017 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

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

from openerp import models, api, fields


class HrPayslip(models.Model):
_inherit = "hr.payslip"

@api.model
def _default_payslip_type(self):
payslip_type_normal = self.env.ref(
"hr_payslip_type.hr_payslip_type_normal"
)
return payslip_type_normal.id

payslip_type_id = fields.Many2one(
string="Payslip Type",
comodel_name="hr.payslip.type",
default=_default_payslip_type
)
14 changes: 14 additions & 0 deletions hr_payslip_type/models/hr_payslip_run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# -*- coding: utf-8 -*-
# Copyright 2017 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from openerp import models, fields


class HrPayslipRun(models.Model):
_inherit = "hr.payslip.run"

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

from openerp import models, fields


class HrPayslipType(models.Model):
_name = "hr.payslip.type"
_description = "Type of Payslip"

name = fields.Char(
string="Name",
required=True
)
description = fields.Text(
string="Description"
)
active = fields.Boolean(
string="active",
default=True
)
2 changes: 2 additions & 0 deletions hr_payslip_type/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_hr_payslip_type,hr.payslip.type,model_hr_payslip_type,base.group_hr_user,1,1,1,1
28 changes: 28 additions & 0 deletions hr_payslip_type/views/hr_payslip_run_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="hr_payslip_run_view_form" model="ir.ui.view">
<field name="name">Inherit HR Payslip Run Form</field>
<field name="model">hr.payslip.run</field>
<field name="inherit_id" ref="hr_payroll.hr_payslip_run_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='credit_note']" position="after">
<field name="payslip_type_id" />
</xpath>
</field>
</record>

<record id="hr_payslip_run_view_tree" model="ir.ui.view">
<field name="name">Inherit HR Payslip Run Tree</field>
<field name="model">hr.payslip.run</field>
<field name="inherit_id" ref="hr_payroll.hr_payslip_run_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='credit_note']" position="after">
<field name="payslip_type_id" />
</xpath>
</field>
</record>

</data>
</openerp>

58 changes: 58 additions & 0 deletions hr_payslip_type/views/hr_payslip_type_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2017 OpenSynergy Indonesia
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->

<openerp>
<data>

<record id="hr_payslip_type_view_tree" model="ir.ui.view">
<field name="name">Tree Hr Payslip Type</field>
<field name="model">hr.payslip.type</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="description"/>
<field name="active"/>
</tree>
</field>
</record>

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

<record id="hr_payslip_type_action" model="ir.actions.act_window">
<field name="name">Payslip Type</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">hr.payslip.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 Payslip Type.
</p>
</field>
</record>

<menuitem
id="hr_payslip_type_menu"
name="Payslip Type"
parent="hr_payroll.payroll_configure"
groups="base.group_hr_user"
action="hr_payslip_type_action"
/>

</data>
</openerp>
29 changes: 29 additions & 0 deletions hr_payslip_type/views/hr_payslip_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>

<record id="hr_payslip_view_tree" model="ir.ui.view">
<field name="name">Inherit HR Payslip Tree</field>
<field name="model">hr.payslip</field>
<field name="inherit_id" ref="hr_payroll.view_hr_payslip_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='name']" position="after">
<field name="payslip_type_id" />
</xpath>
</field>
</record>

<record id="hr_payslip_view_form" model="ir.ui.view">
<field name="name">Inherit HR Payslip Form</field>
<field name="model">hr.payslip</field>
<field name="inherit_id" ref="hr_payroll.view_hr_payslip_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='name']" position="after">
<field name="payslip_type_id" />
</xpath>
</field>
</record>

</data>
</openerp>

0 comments on commit 08abe56

Please sign in to comment.