Add module hr_expense_usability

This commit is contained in:
Alexis de Lattre
2015-11-16 18:57:55 +01:00
parent 9b4c770382
commit fec06bbb59
4 changed files with 77 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
HR Expense Usability
====================
This module adds a few usability enhancements to the official Expense modules:
* Re-organise access rights: Officer can see the expense notes of his subordinates ; Manager can see all expense notes
Credits
=======
Contributors
------------
* Alexis de Lattre <alexis.delattre@akretion.com>

View File

@@ -0,0 +1 @@
# -*- coding: utf-8 -*-

View File

@@ -0,0 +1,38 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# HR Expense Usability module for Odoo
# Copyright (C) 2015 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': 'HR Expense Usability',
'version': '0.1',
'category': 'Human Resources',
'license': 'AGPL-3',
'summary': 'Better usability for the management of expenses',
'description': '',
'author': 'Akretion',
'website': 'http://www.akretion.com',
'depends': ['hr_expense'],
'data': [
'security/expense_security.xml',
],
'installable': True,
}

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="0">
<!--
Employee : only see his expenses
HR Officer = the manager of some employees : see his expenses and the ones of his subordinates
HR Manager = person that administrates the expense process : can see everything
-->
<!-- inherit native ir.rule ; remove HR Officer from 1=1 rule -->
<record id="hr_expense.property_rule_expense_manager" model="ir.rule">
<field name="groups" eval="[(6, 0, [ref('base.group_hr_manager')])]"/>
</record>
<record id="hr_expense_officer_see_subordinates" model="ir.rule">
<field name="name">HR Officer can see expenses of his subordinates</field>
<field name="model_id" ref="hr_expense.model_hr_expense_expense"/>
<field name="domain_force">['|', ('employee_id.user_id','=',user.id), ('employee_id','child_of',user.employee_ids.ids)]</field>
<field name="groups" eval="[(4, ref('base.group_hr_user'))]"/>
</record>
</data>
</openerp>