Skip to content

Commit

Permalink
[8.0.1.0.0] hr_expense_security
Browse files Browse the repository at this point in the history
  • Loading branch information
andhit-r committed Feb 17, 2019
1 parent 69598bb commit f549be5
Show file tree
Hide file tree
Showing 11 changed files with 518 additions and 0 deletions.
40 changes: 40 additions & 0 deletions hr_expense_security/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
.. 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

================
Expense Security
================



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 *Expense Security*
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.
3 changes: 3 additions & 0 deletions hr_expense_security/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2019 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
22 changes: 22 additions & 0 deletions hr_expense_security/__openerp__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# Copyright 2019 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# pylint: disable=locally-disabled, manifest-required-author
{
"name": "Expense Security",
"version": "8.0.1.0.0",
"category": "Human Resource",
"website": "https://opensynergy-indonesia.com",
"author": "OpenSynergy Indonesia",
"license": "AGPL-3",
"installable": True,
"depends": [
"hr_expense",
],
"data": [
"security/ir_module_category_data.xml",
"security/res_groups_data.xml",
"security/ir_rule_data.xml",
"views/hr_expense_views.xml",
],
}
57 changes: 57 additions & 0 deletions hr_expense_security/l18n/en_US.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_expense_security
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-02-17 17:15+0000\n"
"PO-Revision-Date: 2019-02-17 17:15+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: hr_expense_security
#: model:res.groups,name:hr_expense_security.group_expense_operation_company
#: model:res.groups,name:hr_expense_security.group_expense_viewer_company
msgid "Company"
msgstr "Company"

#. module: hr_expense_security
#: model:res.groups,name:hr_expense_security.group_expense_operation_department
#: model:res.groups,name:hr_expense_security.group_expense_viewer_department
msgid "Department"
msgstr "Department"

#. module: hr_expense_security
#: model:ir.module.category,name:hr_expense_security.module_hr_expense_operation
msgid "Employee Expense Operation"
msgstr "Employee Expense Operation"

#. module: hr_expense_security
#: model:ir.module.category,name:hr_expense_security.module_hr_expense_viewer
msgid "Employee Expense Viewer"
msgstr "Employee Expense Viewer"

#. module: hr_expense_security
#: model:ir.actions.act_window,name:hr_expense_security.hr_expense_my_action
#: model:ir.ui.menu,name:hr_expense_security.hr_expense_my_menu
msgid "My Expenses"
msgstr "My Expenses"

#. module: hr_expense_security
#: model:res.groups,name:hr_expense_security.group_expense_operation_supervisor
#: model:res.groups,name:hr_expense_security.group_expense_viewer_supervisor
msgid "Supervisor"
msgstr "Supervisor"

#. module: hr_expense_security
#: view:hr.expense.expense:hr_expense_security.hr_expense_view_form
#: view:hr.expense.expense:hr_expense_security.hr_expense_view_tree
msgid "context.get('hide_employee_field',0)"
msgstr "context.get('hide_employee_field',0)"

57 changes: 57 additions & 0 deletions hr_expense_security/l18n/hr_expense_security.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_expense_security
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-02-17 17:14+0000\n"
"PO-Revision-Date: 2019-02-17 17:14+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: hr_expense_security
#: model:res.groups,name:hr_expense_security.group_expense_operation_company
#: model:res.groups,name:hr_expense_security.group_expense_viewer_company
msgid "Company"
msgstr ""

#. module: hr_expense_security
#: model:res.groups,name:hr_expense_security.group_expense_operation_department
#: model:res.groups,name:hr_expense_security.group_expense_viewer_department
msgid "Department"
msgstr ""

#. module: hr_expense_security
#: model:ir.module.category,name:hr_expense_security.module_hr_expense_operation
msgid "Employee Expense Operation"
msgstr ""

#. module: hr_expense_security
#: model:ir.module.category,name:hr_expense_security.module_hr_expense_viewer
msgid "Employee Expense Viewer"
msgstr ""

#. module: hr_expense_security
#: model:ir.actions.act_window,name:hr_expense_security.hr_expense_my_action
#: model:ir.ui.menu,name:hr_expense_security.hr_expense_my_menu
msgid "My Expenses"
msgstr ""

#. module: hr_expense_security
#: model:res.groups,name:hr_expense_security.group_expense_operation_supervisor
#: model:res.groups,name:hr_expense_security.group_expense_viewer_supervisor
msgid "Supervisor"
msgstr ""

#. module: hr_expense_security
#: view:hr.expense.expense:hr_expense_security.hr_expense_view_form
#: view:hr.expense.expense:hr_expense_security.hr_expense_view_tree
msgid "context.get('hide_employee_field',0)"
msgstr ""

57 changes: 57 additions & 0 deletions hr_expense_security/l18n/id.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_expense_security
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-02-17 17:15+0000\n"
"PO-Revision-Date: 2019-02-17 17:15+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: hr_expense_security
#: model:res.groups,name:hr_expense_security.group_expense_operation_company
#: model:res.groups,name:hr_expense_security.group_expense_viewer_company
msgid "Company"
msgstr "Company"

#. module: hr_expense_security
#: model:res.groups,name:hr_expense_security.group_expense_operation_department
#: model:res.groups,name:hr_expense_security.group_expense_viewer_department
msgid "Department"
msgstr "Department"

#. module: hr_expense_security
#: model:ir.module.category,name:hr_expense_security.module_hr_expense_operation
msgid "Employee Expense Operation"
msgstr "Employee Expense Operation"

#. module: hr_expense_security
#: model:ir.module.category,name:hr_expense_security.module_hr_expense_viewer
msgid "Employee Expense Viewer"
msgstr "Employee Expense Viewer"

#. module: hr_expense_security
#: model:ir.actions.act_window,name:hr_expense_security.hr_expense_my_action
#: model:ir.ui.menu,name:hr_expense_security.hr_expense_my_menu
msgid "My Expenses"
msgstr "My Expenses"

#. module: hr_expense_security
#: model:res.groups,name:hr_expense_security.group_expense_operation_supervisor
#: model:res.groups,name:hr_expense_security.group_expense_viewer_supervisor
msgid "Supervisor"
msgstr "Supervisor"

#. module: hr_expense_security
#: view:hr.expense.expense:hr_expense_security.hr_expense_view_form
#: view:hr.expense.expense:hr_expense_security.hr_expense_view_tree
msgid "context.get('hide_employee_field',0)"
msgstr "context.get('hide_employee_field',0)"

17 changes: 17 additions & 0 deletions hr_expense_security/security/ir_module_category_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<!-- Copyright 2019 OpenSynergy Indonesia
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->

<openerp>
<data>

<record id="module_hr_expense_operation" model="ir.module.category">
<field name="name">Employee Expense Operation</field>
</record>

<record id="module_hr_expense_viewer" model="ir.module.category">
<field name="name">Employee Expense Viewer</field>
</record>

</data>
</openerp>
109 changes: 109 additions & 0 deletions hr_expense_security/security/ir_rule_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2019 OpenSynergy Indonesia
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<openerp>
<data>
<!-- All Employee -->
<record id="ir_rule_expense_viewer_employee"
model="ir.rule">
<field name="model_id" ref="hr_expense.model_hr_expense_expense"/>
<field name="domain_force">[
('employee_id.user_id.id','=',user.id)
]</field>
<field name="name">Employee Expense Rule for Employee</field>
<field name="groups" eval="[(4, ref('base.group_user'))]"/>
<field eval="1" name="perm_unlink"/>
<field eval="1" name="perm_write"/>
<field eval="1" name="perm_read"/>
<field eval="1" name="perm_create"/>
</record>

<!-- Operation -->
<record id="ir_rule_expense_operation_supervisor"
model="ir.rule">
<field name="model_id" ref="hr_expense.model_hr_expense_expense"/>
<field name="domain_force">[
('user_valid.id','=',user.id),
]</field>
<field name="name">Employee Expense Operation Rule for Manager</field>
<field name="groups" eval="[(4, ref('group_expense_operation_supervisor'))]"/>
<field eval="1" name="perm_unlink"/>
<field eval="1" name="perm_write"/>
<field eval="1" name="perm_read"/>
<field eval="1" name="perm_create"/>
</record>

<record id="ir_rule_expense_operation_department"
model="ir.rule">
<field name="model_id" ref="hr_expense.model_hr_expense_expense"/>
<field name="domain_force">[
('department_id.id','child_of',user.employee_ids[0].department_id.id),
]</field>
<field name="name">Employee Expense Operation Rule for Department</field>
<field name="groups" eval="[(4, ref('group_expense_operation_department'))]"/>
<field eval="1" name="perm_unlink"/>
<field eval="1" name="perm_write"/>
<field eval="1" name="perm_read"/>
<field eval="1" name="perm_create"/>
</record>

<record id="ir_rule_expense_operation_company"
model="ir.rule">
<field name="model_id" ref="hr_expense.model_hr_expense_expense"/>
<field name="domain_force">[
('company_id.id','child_of',user.company_id.id),
]</field>
<field name="name">Employee Expense Operation Rule for Company</field>
<field name="groups" eval="[(4, ref('group_expense_operation_company'))]"/>
<field eval="1" name="perm_unlink"/>
<field eval="1" name="perm_write"/>
<field eval="1" name="perm_read"/>
<field eval="1" name="perm_create"/>
</record>

<!-- Viewer -->
<record id="ir_rule_expense_viewer_supervisor"
model="ir.rule">
<field name="model_id" ref="hr_expense.model_hr_expense_expense"/>
<field name="domain_force">[
('user_valid.id','=',user.id),
]</field>
<field name="name">Employee Expense Viewer Rule for Manager</field>
<field name="groups" eval="[(4, ref('group_expense_viewer_supervisor'))]"/>
<field eval="0" name="perm_unlink"/>
<field eval="0" name="perm_write"/>
<field eval="1" name="perm_read"/>
<field eval="0" name="perm_create"/>
</record>

<record id="ir_rule_expense_viewer_department"
model="ir.rule">
<field name="model_id" ref="hr_expense.model_hr_expense_expense"/>
<field name="domain_force">[
('department_id.id','child_of',user.employee_ids[0].department_id.id),
]</field>
<field name="name">Employee Expense Viewer Rule for Department</field>
<field name="groups" eval="[(4, ref('group_expense_viewer_department'))]"/>
<field eval="0" name="perm_unlink"/>
<field eval="0" name="perm_write"/>
<field eval="1" name="perm_read"/>
<field eval="0" name="perm_create"/>
</record>

<record id="ir_rule_expense_viewer_company"
model="ir.rule">
<field name="model_id" ref="hr_expense.model_hr_expense_expense"/>
<field name="domain_force">[
('company_id.id','child_of',user.company_id.id),
]</field>
<field name="name">Employee Expense Viewer Rule for Company</field>
<field name="groups" eval="[(4, ref('group_expense_viewer_company'))]"/>
<field eval="0" name="perm_unlink"/>
<field eval="0" name="perm_write"/>
<field eval="1" name="perm_read"/>
<field eval="0" name="perm_create"/>
</record>


</data>
</openerp>

0 comments on commit f549be5

Please sign in to comment.