Skip to content

Commit

Permalink
[8.0.1.0.0][hr_payslip_multiple_approval]
Browse files Browse the repository at this point in the history
  • Loading branch information
mikevhe18 committed Sep 22, 2020
1 parent 870e03f commit 7ecaebf
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 170 deletions.
18 changes: 9 additions & 9 deletions hr_payslip_multiple_approval/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

=======================
Payslip Tier Validation
=======================
=========================
Payslip Multiple Approval
=========================

This module extends the functionality of Payslip
to support a tier validation process.
to support a Multiple Approval process.

Installation
============
Expand All @@ -18,7 +18,7 @@ To install this module, you need to:
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 *Payslip Tier Validation*
5. Search For *Payslip Multiple Approval*
6. Install the module

Bug Tracker
Expand All @@ -43,8 +43,8 @@ Contributors
Maintainer
----------

.. image:: https://opensynergy-indonesia.com/logo.png
:alt: OpenSynergy Indonesia
:target: https://opensynergy-indonesia.com
.. image:: https://simetri-sinergi.id/logo.png
:alt: PT. Simetri Sinergi Indonesia
:target: https://simetri-sinergi.id.com

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

from . import models
from . import(
models,
)
14 changes: 8 additions & 6 deletions hr_payslip_multiple_approval/__openerp__.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# Copyright 2020 OpenSynergy Indonesia
# Copyright 2020 PT. Simetri Sinergi Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# pylint: disable=locally-disabled, manifest-required-author
{
"name": "Payslip Tier Validation",
"name": "Payslip Multiple Approval",
"version": "8.0.1.0.0",
"website": "https://opensynergy-indonesia.com",
"author": "OpenSynergy Indonesia",
"website": "https://simetri-sinergi.id",
"author": "PT. Simetri Sinergi Indonesia, OpenSynergy Indonesia",
"license": "AGPL-3",
"installable": False,
"installable": True,
"auto_install": True,
"depends": [
"hr_payslip_extend",
"base_tier_validation",
"base_multiple_approval",
],
"data": [
"views/hr_payslip_views.xml"
Expand Down
127 changes: 0 additions & 127 deletions hr_payslip_multiple_approval/i18n/hr_payslip_tier_validation.pot

This file was deleted.

12 changes: 7 additions & 5 deletions hr_payslip_multiple_approval/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import hr_payslip
from . import tier_definition
# Copyright 2020 OpenSynergy Indonesia
# Copyright 2020 PT. Simetri Sinergi Indonesia
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import(
hr_payslip,
tier_definition,
)
44 changes: 37 additions & 7 deletions hr_payslip_multiple_approval/models/hr_payslip.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,42 @@
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from openerp import models
# Copyright 2020 OpenSynergy Indonesia
# Copyright 2020 PT. Simetri Sinergi Indonesia
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from openerp import models, api


class HrPayslip(models.Model):
_name = "hr.payslip"
_inherit = ["hr.payslip", "tier.validation"]
_state_from = ["verify"]
_state_to = ["done"]
_inherit = [
"hr.payslip",
"tier.validation",
]
_state_from = [
"draft",
"verify",
]
_state_to = [
"done",
]

@api.multi
def validate_tier(self):
_super = super(HrPayslip, self)
_super.validate_tier()
for document in self:
if document.validated:
document.signal_workflow("button_done")

@api.multi
def restart_validation(self):
_super = super(HrPayslip, self)
_super.restart_validation()
for document in self:
document.request_validation()

@api.multi
def hr_verify_sheet(self):
_super = super(HrPayslip, self)
_super.hr_verify_sheet()
for document in self:
document.request_validation()
6 changes: 3 additions & 3 deletions hr_payslip_multiple_approval/models/tier_definition.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

# Copyright 2020 OpenSynergy Indonesia
# Copyright 2020 PT. Simetri Sinergi Indonesia
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from openerp import api, models


Expand Down
Binary file modified hr_payslip_multiple_approval/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.
24 changes: 14 additions & 10 deletions hr_payslip_multiple_approval/views/hr_payslip_views.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
<?xml version="1.0"?>
<!-- Copyright 2020 OpenSynergy Indonesia
Copyright 2020 PT. Simetri Sinergi Indonesia
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<openerp>
<data>
<record id="hr_payslip_view_form" model="ir.ui.view">
<field name="name">hr.payslip.form tier validation form</field>
<field name="model">hr.payslip</field>
<field name="inherit_id" ref="hr_payroll.view_hr_payslip_form"/>
<field name="arch" type="xml">
<button name="hr_verify_sheet" position="before">
<xpath expr="//button[@name='hr_verify_sheet']" position="before">
<button name="request_validation"
string="Request Validation"
attrs="{'invisible': ['|','|',('need_validation', '!=', True),('rejected','=',True),('state','not in',['verify'])]}"
Expand All @@ -15,8 +18,8 @@
string="Restart Validation"
attrs="{'invisible': ['|','|',('review_ids', '=', []),('rejected','=',False),('state','not in',['verify'])]}"
type="object"/>
</button>
<header position="after">
</xpath>
<xpath expr="//header" position="after">
<field name="need_validation" invisible="1"/>
<field name="validated" invisible="1"/>
<field name="rejected" invisible="1"/>
Expand Down Expand Up @@ -50,12 +53,16 @@
style="margin-bottom:0px;">
<p><i class="fa fa-thumbs-down"/> Operation has been <b>rejected</b>.</p>
</div>
</header>
<notebook position="inside">
</xpath>
<xpath expr="//notebook" position="inside">
<page string="Reviews" name="tier_validation">
<field name="review_ids" readonly="1"/>
<group>
<field name="definition_id"/>
<field name="reviewer_partner_ids" widget="many2many_tags"/>
<field name="review_ids" readonly="1"/>
</group>
</page>
</notebook>
</xpath>
</field>
</record>

Expand All @@ -68,9 +75,6 @@
<filter name="needs_review" string="Needs my Review"
domain="[('reviewer_ids','in',uid), ('state', 'not in', ['done', 'cancel'])]"
help="My Payslip to review"/>
<filter name="tier_validated" string="Validated"
domain="[('validated', '=', True)]"
help="Payslip validated and ready to be confirmed"/>
</xpath>
</field>
</record>
Expand Down

0 comments on commit 7ecaebf

Please sign in to comment.