diff --git a/hr_custody/README.rst b/hr_custody/README.rst
new file mode 100644
index 000000000..71b8516d3
--- /dev/null
+++ b/hr_custody/README.rst
@@ -0,0 +1,47 @@
+OHRMS Custody Management
+=====================
+
+Functionality to give and track the assets of a company to employees.
+ - Creates a new menu item Custody Management under Employees
+ - Can create custody contract with an employee
+ - Can take the report of custody
+
+Depends
+=======
+[hr, mail, hr_employee_updation] addon Odoo
+
+Tech
+====
+* [Python] - Models
+* [XML] - Odoo views
+
+Installation
+============
+- www.odoo.com/documentation/10.0/setup/install.html
+- Install our custom addon
+
+License
+=======
+GNU AFFERO GENERAL PUBLIC LICENSE, Version 3 (AGPLv3)
+(http://www.gnu.org/licenses/agpl.html)
+
+Bug Tracker
+===========
+Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported.
+
+Credits
+=======
+* Cybrosys Techno Solutions
+
+Author
+------
+
+Developers: Avinash Nk
+ Jesni Banu
+
+Maintainer
+----------
+
+This module is maintained by Cybrosys Technologies.
+
+For support and more information, please visit https://www.cybrosys.com.
diff --git a/hr_custody/RELEASE_NOTES.md b/hr_custody/RELEASE_NOTES.md
new file mode 100644
index 000000000..946cda1b9
--- /dev/null
+++ b/hr_custody/RELEASE_NOTES.md
@@ -0,0 +1,6 @@
+## Module hr_custody
+
+#### 30.03.2018
+#### Version 10.0.1.0.0
+##### ADD
+- Initial commit for OpenHrms Project
diff --git a/hr_custody/__init__.py b/hr_custody/__init__.py
new file mode 100644
index 000000000..fab433624
--- /dev/null
+++ b/hr_custody/__init__.py
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+###################################################################################
+# A part of OpenHRMS Project
+#
+# Cybrosys Technologies Pvt. Ltd.
+# Copyright (C) 2018-TODAY Cybrosys Technologies ().
+# Author: <<< Avinash Nk, Jesni Banu>>> ()
+#
+# This program is free software: you can modify
+# it under the terms of the GNU Affero General Public License (AGPL) 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 .
+#
+###################################################################################
+from . import models
+from . import reports
diff --git a/hr_custody/__manifest__.py b/hr_custody/__manifest__.py
new file mode 100644
index 000000000..62bda7eb2
--- /dev/null
+++ b/hr_custody/__manifest__.py
@@ -0,0 +1,50 @@
+# -*- coding: utf-8 -*-
+###################################################################################
+# A part of OpenHRMS Project
+#
+# Cybrosys Technologies Pvt. Ltd.
+# Copyright (C) 2018-TODAY Cybrosys Technologies ().
+# Author: Avinash Nk, Jesni Banu ()
+#
+# This program is free software: you can modify
+# it under the terms of the GNU Affero General Public License (AGPL) 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 .
+#
+###################################################################################
+{
+ 'name': 'OHRMS Custody',
+ 'version': '10.0.1.0.0',
+ 'summary': """Manage the company properties when it is in the custody of an employee""",
+ 'description': 'Manage the company properties when it is in the custody of an employee',
+ 'category': 'Human Resources',
+ 'author': 'Cybrosys Techno Solutions',
+ 'company': 'Cybrosys Techno Solutions',
+ 'maintainer': 'Cybrosys Techno Solutions',
+ 'website': "https://www.openhrms.com",
+ 'depends': ['hr', 'mail', 'hr_employee_updation'],
+ 'data': [
+ 'security/ir.model.access.csv',
+ 'security/custody_security.xml',
+ 'views/wizard_reason_view.xml',
+ 'views/custody_view.xml',
+ 'views/hr_custody_notification.xml',
+ 'views/hr_employee_view.xml',
+ 'views/notification_mail.xml',
+ 'reports/custody_report.xml'
+ ],
+ 'images': ['static/description/banner.jpg'],
+ 'license': 'AGPL-3',
+ 'demo': [],
+ 'installable': True,
+ 'auto_install': False,
+ 'application': False,
+}
diff --git a/hr_custody/models/__init__.py b/hr_custody/models/__init__.py
new file mode 100644
index 000000000..3fbb89a4d
--- /dev/null
+++ b/hr_custody/models/__init__.py
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+###################################################################################
+# A part of OpenHRMS Project
+#
+# Cybrosys Technologies Pvt. Ltd.
+# Copyright (C) 2018-TODAY Cybrosys Technologies ().
+# Author: Avinash Nk, Jesni Banu ()
+#
+# This program is free software: you can modify
+# it under the terms of the GNU Affero General Public License (AGPL) 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 .
+#
+###################################################################################
+from . import custody
+from . import hr_employee
+from . import wizard_reason
diff --git a/hr_custody/models/custody.py b/hr_custody/models/custody.py
new file mode 100644
index 000000000..9ee2b8b0e
--- /dev/null
+++ b/hr_custody/models/custody.py
@@ -0,0 +1,208 @@
+# -*- coding: utf-8 -*-
+###################################################################################
+# A part of OpenHRMS Project
+#
+# Cybrosys Technologies Pvt. Ltd.
+# Copyright (C) 2018-TODAY Cybrosys Technologies ().
+# Author: Avinash Nk, Jesni Banu ()
+#
+# This program is free software: you can modify
+# it under the terms of the GNU Affero General Public License (AGPL) 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 .
+#
+###################################################################################
+from datetime import datetime, timedelta
+from odoo import models, fields, api, _
+from odoo.exceptions import Warning, UserError
+from odoo.tools import image_resize_images
+
+
+class HrCustody(models.Model):
+ """
+ Hr custody contract creation model.
+ """
+ _name = 'hr.custody'
+ _description = 'Hr Custody Management'
+ _inherit = ['mail.thread', 'ir.needaction_mixin']
+
+ def mail_reminder(self):
+ now = datetime.now() + timedelta(days=1)
+ date_now = now.date()
+ match = self.search([('state', '=', 'approved')])
+ for i in match:
+ if i.return_date:
+ exp_date = fields.Date.from_string(i.return_date)
+ if exp_date <= date_now:
+ base_url = self.env['ir.config_parameter'].get_param('web.base.url')
+ url = base_url + _('/web#id=%s&view_type=form&model=hr.custody&menu_id=') % i.id
+ mail_content = _('Hi %s, As per the %s you took %s on %s for the reason of %s. S0 here we '
+ 'remind you that you have to return that on or before %s. Otherwise, you can '
+ 'renew the reference number(%s) by extending the return date through following '
+ 'link.
') % \
+ (i.employee.name, i.name, i.custody_name.name, i.date_request, i.purpose,
+ date_now, i.name, url, i.name)
+ main_content = {
+ 'subject': _('REMINDER On %s') % i.name,
+ 'author_id': self.env.user.partner_id.id,
+ 'body_html': mail_content,
+ 'email_to': i.employee.work_email,
+ }
+ mail_id = self.env['mail.mail'].create(main_content)
+ mail_id.mail_message_id.body = mail_content
+ mail_id.send()
+ if i.employee.user_id:
+ mail_id.mail_message_id.write({'needaction_partner_ids': [(4, i.employee.user_id.partner_id.id)]})
+ mail_id.mail_message_id.write({'partner_ids': [(4, i.employee.user_id.partner_id.id)]})
+
+ @api.model
+ def create(self, vals):
+ vals['name'] = self.env['ir.sequence'].next_by_code('hr.custody')
+ return super(HrCustody, self).create(vals)
+
+ @api.multi
+ def sent(self):
+ self.state = 'to_approve'
+
+ @api.multi
+ def send_mail(self):
+ template = self.env.ref('hr_custody.custody_email_notification_template')
+ self.env['mail.template'].browse(template.id).send_mail(self.id)
+ self.mail_send = True
+
+ @api.multi
+ def set_to_draft(self):
+ self.state = 'draft'
+
+ @api.multi
+ def renew_approve(self):
+ for custody in self.env['hr.custody'].search([('custody_name', '=', self.custody_name.id)]):
+ if custody.state == "approved":
+ raise UserError(_("Custody is not available now"))
+ self.return_date = self.renew_date
+ self.renew_date = ''
+ self.state = 'approved'
+
+ @api.multi
+ def renew_refuse(self):
+ for custody in self.env['hr.custody'].search([('custody_name', '=', self.custody_name.id)]):
+ if custody.state == "approved":
+ raise UserError(_("Custody is not available now"))
+ self.renew_date = ''
+ self.state = 'approved'
+
+ @api.multi
+ def approve(self):
+ for custody in self.env['hr.custody'].search([('custody_name', '=', self.custody_name.id)]):
+ if custody.state == "approved":
+ raise UserError(_("Custody is not available now"))
+ self.state = 'approved'
+
+ @api.multi
+ def set_to_return(self):
+ self.state = 'returned'
+ self.return_date = fields.datetime.now()
+
+ # return date validation
+ @api.constrains('return_date')
+ def validate_return_date(self):
+ if self.return_date < self.date_request:
+ raise Warning('Please Give Valid Return Date')
+
+ name = fields.Char(string='Code', copy=False)
+ company_id = fields.Many2one('res.company', 'Company', readonly=True,
+ default=lambda self: self.env.user.company_id)
+ rejected_reason = fields.Text(string='Rejected Reason', copy=False, readonly=1)
+ renew_rejected_reason = fields.Text(string='Renew Rejected Reason', copy=False, readonly=1)
+ date_request = fields.Date(string='Requested Date', required=True, track_visibility='always', readonly=True,
+ states={'draft': [('readonly', False)]})
+ employee = fields.Many2one('hr.employee', string='Employee', required=True, readonly=True,
+ states={'draft': [('readonly', False)]})
+ purpose = fields.Char(string='Reason', track_visibility='always', required=True, readonly=True,
+ states={'draft': [('readonly', False)]})
+ custody_name = fields.Many2one('custody.property', string='Property', required=True, readonly=True,
+ states={'draft': [('readonly', False)]})
+ return_date = fields.Date(string='Return Date', required=True, track_visibility='always', readonly=True,
+ states={'draft': [('readonly', False)]})
+ renew_date = fields.Date(string='Renewal Return Date', track_visibility='always', readonly=True, copy=False)
+ notes = fields.Html(string='Notes')
+ renew_return_date = fields.Boolean(default=False, copy=False)
+ renew_reject = fields.Boolean(default=False, copy=False)
+ state = fields.Selection([('draft', 'Draft'), ('to_approve', 'Waiting For Approval'), ('approved', 'Approved'),
+ ('returned', 'Returned'), ('rejected', 'Refused')], string='Status', default='draft',
+ track_visibility='always')
+ mail_send = fields.Boolean(string="Mail Send")
+
+
+class HrPropertyName(models.Model):
+ """
+ Hr property creation model.
+ """
+ _name = 'custody.property'
+ _description = 'Property Name'
+
+ name = fields.Char(string='Property Name', required=True)
+ image = fields.Binary(
+ "Image", attachment=True,
+ help="This field holds the image used for this provider, limited to 1024x1024px")
+ image_medium = fields.Binary(
+ "Medium-sized image", attachment=True,
+ help="Medium-sized image of this provider. It is automatically "
+ "resized as a 128x128px image, with aspect ratio preserved. "
+ "Use this field in form views or some kanban views.")
+ image_small = fields.Binary(
+ "Small-sized image", attachment=True,
+ help="Small-sized image of this provider. It is automatically "
+ "resized as a 64x64px image, with aspect ratio preserved. "
+ "Use this field anywhere a small image is required.")
+ desc = fields.Html(string='Description')
+ company_id = fields.Many2one('res.company', 'Company',
+ default=lambda self: self.env.user.company_id)
+
+ @api.model
+ def create(self, vals):
+ image_resize_images(vals)
+ return super(HrPropertyName, self).create(vals)
+
+ @api.multi
+ def write(self, vals):
+ image_resize_images(vals)
+ return super(HrPropertyName, self).write(vals)
+
+
+class HrReturnDate(models.TransientModel):
+ """Hr custody contract renewal wizard"""
+ _name = 'wizard.return.date'
+ _description = 'Hr Custody Name'
+
+ returned_date = fields.Date(string='Renewal Date', required=1)
+
+ # renewal date validation
+ @api.constrains('returned_date')
+ def validate_return_date(self):
+ context = self._context
+ custody_obj = self.env['hr.custody'].search([('id', '=', context.get('custody_id'))])
+ if self.returned_date <= custody_obj.date_request:
+ raise Warning('Please Give Valid Renewal Date')
+
+ @api.multi
+ def proceed(self):
+ context = self._context
+ custody_obj = self.env['hr.custody'].search([('id', '=', context.get('custody_id'))])
+ custody_obj.write({'renew_return_date': True,
+ 'renew_date': self.returned_date,
+ 'state': 'to_approve'})
diff --git a/hr_custody/models/hr_employee.py b/hr_custody/models/hr_employee.py
new file mode 100644
index 000000000..0776c4395
--- /dev/null
+++ b/hr_custody/models/hr_employee.py
@@ -0,0 +1,118 @@
+# -*- coding: utf-8 -*-
+###################################################################################
+# A part of OpenHRMS Project
+#
+# Cybrosys Technologies Pvt. Ltd.
+# Copyright (C) 2018-TODAY Cybrosys Technologies ().
+# Author: Avinash Nk, Jesni Banu ()
+#
+# This program is free software: you can modify
+# it under the terms of the GNU Affero General Public License (AGPL) 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 .
+#
+###################################################################################
+from odoo import models, fields, api, _
+
+
+class HrCustody(models.Model):
+ _inherit = 'hr.employee'
+
+ custody_count = fields.Integer(compute='_custody_count', string='# Custody')
+ equipment_count = fields.Integer(compute='_equipment_count', string='# Equipments')
+
+ # count of all custody contracts
+ @api.multi
+ def _custody_count(self):
+ for each in self:
+ custody_ids = self.env['hr.custody'].search([('employee', '=', each.id)])
+ each.custody_count = len(custody_ids)
+
+ # count of all custody contracts that are in approved state
+ @api.multi
+ def _equipment_count(self):
+ for each in self:
+ equipment_obj = self.env['hr.custody'].search([('employee', '=', each.id), ('state', '=', 'approved')])
+ equipment_ids = []
+ for each1 in equipment_obj:
+ if each1.custody_name.id not in equipment_ids:
+ equipment_ids.append(each1.custody_name.id)
+ each.equipment_count = len(equipment_ids)
+
+ # smart button action for returning the view of all custody contracts related to the current employee
+ @api.multi
+ def custody_view(self):
+ for each1 in self:
+ custody_obj = self.env['hr.custody'].search([('employee', '=', each1.id)])
+ custody_ids = []
+ for each in custody_obj:
+ custody_ids.append(each.id)
+ view_id = self.env.ref('hr_custody.hr_custody_form_view').id
+ if custody_ids:
+ if len(custody_ids) <= 1:
+ value = {
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'res_model': 'hr.custody',
+ 'view_id': view_id,
+ 'type': 'ir.actions.act_window',
+ 'name': _('Custody'),
+ 'res_id': custody_ids and custody_ids[0]
+ }
+ else:
+ value = {
+ 'domain': str([('id', 'in', custody_ids)]),
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'res_model': 'hr.custody',
+ 'view_id': False,
+ 'type': 'ir.actions.act_window',
+ 'name': _('Custody'),
+ 'res_id': custody_ids
+ }
+
+ return value
+
+ # smart button action for returning the view of all custody contracts that are in approved state,
+ # related to the current employee
+ @api.multi
+ def equipment_view(self):
+ for each1 in self:
+ equipment_obj = self.env['hr.custody'].search([('employee', '=', each1.id), ('state', '=', 'approved')])
+ equipment_ids = []
+ for each in equipment_obj:
+ if each.custody_name.id not in equipment_ids:
+ equipment_ids.append(each.custody_name.id)
+ view_id = self.env.ref('hr_custody.custody_custody_form_view').id
+ if equipment_ids:
+ if len(equipment_ids) <= 1:
+ value = {
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'res_model': 'custody.property',
+ 'view_id': view_id,
+ 'type': 'ir.actions.act_window',
+ 'name': _('Equipments'),
+ 'res_id': equipment_ids and equipment_ids[0]
+ }
+ else:
+ value = {
+ 'domain': str([('id', 'in', equipment_ids)]),
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'res_model': 'custody.property',
+ 'view_id': False,
+ 'type': 'ir.actions.act_window',
+ 'name': _('Equipments'),
+ 'res_id': equipment_ids
+ }
+
+ return value
diff --git a/hr_custody/models/wizard_reason.py b/hr_custody/models/wizard_reason.py
new file mode 100644
index 000000000..982692f4b
--- /dev/null
+++ b/hr_custody/models/wizard_reason.py
@@ -0,0 +1,48 @@
+# -*- coding: utf-8 -*-
+###################################################################################
+# A part of OpenHRMS Project
+#
+# Cybrosys Technologies Pvt. Ltd.
+# Copyright (C) 2018-TODAY Cybrosys Technologies ().
+# Author: Avinash Nk, Jesni Banu ()
+#
+# This program is free software: you can modify
+# it under the terms of the GNU Affero General Public License (AGPL) 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 .
+#
+###################################################################################
+from odoo import models, fields, api, _
+
+
+class WizardReason(models.TransientModel):
+ """
+ Hr custody contract refuse wizard.
+ """
+ _name = 'wizard.reason'
+
+ @api.multi
+ def send_reason(self):
+ context = self._context
+ reject_obj = self.env[context.get('model_id')].search([('id', '=', context.get('reject_id'))])
+ if 'renew' in context.keys():
+ reject_obj.write({'state': 'approved',
+ 'renew_reject': True,
+ 'renew_rejected_reason': self.reason})
+ else:
+ if context.get('model_id') == 'hr.holidays':
+ reject_obj.write({'rejected_reason': self.reason})
+ reject_obj.action_refuse()
+ else:
+ reject_obj.write({'state': 'rejected',
+ 'rejected_reason': self.reason})
+
+ reason = fields.Text(string="Reason")
diff --git a/hr_custody/reports/__init__.py b/hr_custody/reports/__init__.py
new file mode 100644
index 000000000..872680926
--- /dev/null
+++ b/hr_custody/reports/__init__.py
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+###################################################################################
+# A part of OpenHRMS Project
+#
+# Cybrosys Technologies Pvt. Ltd.
+# Copyright (C) 2018-TODAY Cybrosys Technologies ().
+# Author: Avinash Nk, Jesni Banu ()
+#
+# This program is free software: you can modify
+# it under the terms of the GNU Affero General Public License (AGPL) 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 .
+#
+###################################################################################
+from . import custody_report
diff --git a/hr_custody/reports/custody_report.py b/hr_custody/reports/custody_report.py
new file mode 100644
index 000000000..83c4362aa
--- /dev/null
+++ b/hr_custody/reports/custody_report.py
@@ -0,0 +1,84 @@
+# -*- coding: utf-8 -*-
+###################################################################################
+# A part of OpenHRMS Project
+#
+# Cybrosys Technologies Pvt. Ltd.
+# Copyright (C) 2018-TODAY Cybrosys Technologies ().
+# Author: Avinash Nk, Jesni Banu ()
+#
+# This program is free software: you can modify
+# it under the terms of the GNU Affero General Public License (AGPL) 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 .
+#
+###################################################################################
+from odoo import models, fields, tools
+
+
+class CustodyHistory(models.Model):
+ _name = "report.custody"
+ _description = "Custody Analysis"
+ _auto = False
+
+ name = fields.Char(string='Code')
+ date_request = fields.Date(string='Requested Date')
+ employee = fields.Many2one('hr.employee', string='Employee')
+ purpose = fields.Char(string='Reason')
+ custody_name = fields.Many2one('custody.property', string='Custody Name')
+ return_date = fields.Date(string='Return Date')
+ renew_date = fields.Date(string='Renewal Return Date')
+ renew_return_date = fields.Boolean(string='Renewal Return Date')
+ state = fields.Selection([('draft', 'Draft'), ('to_approve', 'Waiting For Approval'), ('approved', 'Approved'),
+ ('returned', 'Returned'), ('rejected', 'Refused')], string='Status')
+
+ _order = 'name desc'
+
+ def _select(self):
+ select_str = """
+ SELECT
+ (select 1 ) AS nbr,
+ t.id as id,
+ t.name as name,
+ t.date_request as date_request,
+ t.employee as employee,
+ t.purpose as purpose,
+ t.custody_name as custody_name,
+ t.return_date as return_date,
+ t.renew_date as renew_date,
+ t.renew_return_date as renew_return_date,
+ t.state as state
+ """
+ return select_str
+
+ def _group_by(self):
+ group_by_str = """
+ GROUP BY
+ t.id,
+ name,
+ date_request,
+ employee,
+ purpose,
+ custody_name,
+ return_date,
+ renew_date,
+ renew_return_date,
+ state
+ """
+ return group_by_str
+
+ def init(self):
+ tools.sql.drop_view_if_exists(self._cr, 'report_custody')
+ self._cr.execute("""
+ CREATE view report_custody as
+ %s
+ FROM hr_custody t
+ %s
+ """ % (self._select(), self._group_by()))
diff --git a/hr_custody/reports/custody_report.xml b/hr_custody/reports/custody_report.xml
new file mode 100644
index 000000000..402d92e7c
--- /dev/null
+++ b/hr_custody/reports/custody_report.xml
@@ -0,0 +1,27 @@
+
+
+
+
+ report.custody.pivot
+ report.custody
+
+
+
+
+
+
+
+
+ Custody Analysis
+ report.custody
+ form
+ pivot
+ {'group_by_no_leaf':1,'group_by':[]}
+ This report allows you to analyse all Custody Requests.
+
+
+
+
+
\ No newline at end of file
diff --git a/hr_custody/security/custody_security.xml b/hr_custody/security/custody_security.xml
new file mode 100644
index 000000000..311521f17
--- /dev/null
+++ b/hr_custody/security/custody_security.xml
@@ -0,0 +1,16 @@
+
+
+
+ Custody Multi Company
+
+
+ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
+
+
+
+ Custody Request Multi Company
+
+
+ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
+
+
diff --git a/hr_custody/security/ir.model.access.csv b/hr_custody/security/ir.model.access.csv
new file mode 100644
index 000000000..2c8043f12
--- /dev/null
+++ b/hr_custody/security/ir.model.access.csv
@@ -0,0 +1,13 @@
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_hr_custody_hr","hr.custody.hr","model_hr_custody","hr.group_hr_manager",1,1,1,1
+"access_hr_custody_hr_manager","hr.custody.user","model_hr_custody","hr.group_hr_user",1,1,1,1
+"access_hr_custody_hr_employee","hr.custody.employee","model_hr_custody","base.group_user",1,1,1,0
+"access_hr_custody_hr1","hr.custody.hr1","model_custody_property","hr.group_hr_manager",1,1,1,1
+"access_hr_custody_hr_manager1","hr.custody.user1","model_custody_property","hr.group_hr_user",1,1,1,1
+"access_hr_custody_hr_employee1","hr.custody.employee1","model_custody_property","base.group_user",1,1,1,0
+"access_hr_custody_hr2","hr.custody.hr2","model_wizard_return_date","hr.group_hr_manager",1,1,1,1
+"access_hr_custody_hr3","hr.custody.hr3","model_report_custody","hr.group_hr_manager",1,1,1,1
+"access_hr_custody_hr_manager2","hr.custody.user2","model_wizard_return_date","hr.group_hr_user",1,1,1,1
+"access_hr_custody_hr_manager3","hr.custody.user3","model_report_custody","hr.group_hr_user",1,1,1,1
+"access_hr_custody_hr_employee2","hr.custody.employee2","model_wizard_return_date","base.group_user",1,1,1,0
+
diff --git a/hr_custody/static/description/HRMS-BUTTON.png b/hr_custody/static/description/HRMS-BUTTON.png
new file mode 100644
index 000000000..0f1b65bea
Binary files /dev/null and b/hr_custody/static/description/HRMS-BUTTON.png differ
diff --git a/hr_custody/static/description/banner.jpg b/hr_custody/static/description/banner.jpg
new file mode 100644
index 000000000..51ca3c8a4
Binary files /dev/null and b/hr_custody/static/description/banner.jpg differ
diff --git a/hr_custody/static/description/custody_management.png b/hr_custody/static/description/custody_management.png
new file mode 100644
index 000000000..f5a04aa0b
Binary files /dev/null and b/hr_custody/static/description/custody_management.png differ
diff --git a/hr_custody/static/description/cybro-service.png b/hr_custody/static/description/cybro-service.png
new file mode 100644
index 000000000..0a648278c
Binary files /dev/null and b/hr_custody/static/description/cybro-service.png differ
diff --git a/hr_custody/static/description/cybro_logo.png b/hr_custody/static/description/cybro_logo.png
new file mode 100644
index 000000000..bb309114c
Binary files /dev/null and b/hr_custody/static/description/cybro_logo.png differ
diff --git a/hr_custody/static/description/icon.png b/hr_custody/static/description/icon.png
new file mode 100644
index 000000000..8c486ecc1
Binary files /dev/null and b/hr_custody/static/description/icon.png differ
diff --git a/hr_custody/static/description/index.html b/hr_custody/static/description/index.html
new file mode 100644
index 000000000..76b4924cc
--- /dev/null
+++ b/hr_custody/static/description/index.html
@@ -0,0 +1,92 @@
+
+
+ ☑ Managing custody handling process.
+ ☑ Option to renewal.
+ ☑ Option to take reports.
+
+
+
+
+
+
+
+
Overview
+
+ Blues over resource tracking? No more worries.
+ OHRMS Custody Management system constitutes the ultimate
+ solution for a transparent custody of company resources.
+