Add module resource_usability
This commit is contained in:
3
resource_usability/__init__.py
Normal file
3
resource_usability/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from . import resource
|
||||||
28
resource_usability/__openerp__.py
Normal file
28
resource_usability/__openerp__.py
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# © 2017 Akretion (http://www.akretion.com)
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
|
|
||||||
|
{
|
||||||
|
'name': 'Resource Usability',
|
||||||
|
'version': '8.0.1.0.1',
|
||||||
|
'category': 'Hidden/Dependency',
|
||||||
|
'license': 'AGPL-3',
|
||||||
|
'summary': 'Resource usability enhancements',
|
||||||
|
'description': """
|
||||||
|
Resource Usability
|
||||||
|
==================
|
||||||
|
|
||||||
|
The usability improvements include :
|
||||||
|
|
||||||
|
* Add a name_get() on resource.calendar.leaves
|
||||||
|
|
||||||
|
This module has been written by Alexis de Lattre from Akretion
|
||||||
|
<alexis.delattre@akretion.com>.
|
||||||
|
""",
|
||||||
|
'author': 'Akretion',
|
||||||
|
'website': 'http://www.akretion.com',
|
||||||
|
'depends': ['resource'],
|
||||||
|
'data': ['resource_view.xml'],
|
||||||
|
'installable': True,
|
||||||
|
}
|
||||||
23
resource_usability/resource.py
Normal file
23
resource_usability/resource.py
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# © 2017 Akretion (http://www.akretion.com)
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
|
|
||||||
|
from openerp import models, api
|
||||||
|
|
||||||
|
|
||||||
|
class ResourceCalendarLeaves(models.Model):
|
||||||
|
_inherit = "resource.calendar.leaves"
|
||||||
|
|
||||||
|
@api.multi
|
||||||
|
def name_get(self):
|
||||||
|
res = []
|
||||||
|
for caleaves in self:
|
||||||
|
name = caleaves.name
|
||||||
|
if caleaves.resource_id:
|
||||||
|
if name:
|
||||||
|
name = '%s (%s)' % (name, caleaves.resource_id.name)
|
||||||
|
else:
|
||||||
|
name = caleaves.resource_id.name
|
||||||
|
res.append((caleaves.id, name))
|
||||||
|
return res
|
||||||
24
resource_usability/resource_view.xml
Normal file
24
resource_usability/resource_view.xml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
© 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||||
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
-->
|
||||||
|
|
||||||
|
<openerp>
|
||||||
|
<data>
|
||||||
|
|
||||||
|
|
||||||
|
<record id="view_resource_calendar" model="ir.ui.view">
|
||||||
|
<field name="name">usability.resource.calendar.leaves.calendar</field>
|
||||||
|
<field name="model">resource.calendar.leaves</field>
|
||||||
|
<field name="inherit_id" ref="resource.view_resource_calendar"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="name" position="after">
|
||||||
|
<field name="resource_id"/>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
|
||||||
|
</data>
|
||||||
|
</openerp>
|
||||||
Reference in New Issue
Block a user