Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions front_office_management/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg
:target: https://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

Front Office Management
============================
Helps You To Manage Front Office Operations.

Configuration
=============
* Install the module and set the permission for Reception

License
-------
Affero General Public License, Version 3 (AGPL v3).
(https://www.gnu.org/licenses/agpl-3.0-standalone.html)

Company
-------
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__

Credits
-------
* Developer: (V17) Ammu Raj, Contact : [email protected]

Contacts
--------
* Mail Contact : [email protected]
* Website : https://cybrosys.com

Bug Tracker
-----------
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported.

Maintainer
==========
.. image:: https://cybrosys.com/images/logo.png
:target: https://cybrosys.com

This module is maintained by Cybrosys Technologies.

For support and more information, please visit `Our Website <https://cybrosys.com/>`__

Further information
===================
HTML Description: `<static/description/index.html>`__
22 changes: 22 additions & 0 deletions front_office_management/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Ammu Raj ([email protected])
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# 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 (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
from . import models
54 changes: 54 additions & 0 deletions front_office_management/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# -*- coding: utf-8 -*-
################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Ammu Raj ([email protected])
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# 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 (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
{
'name': "Front Office Management",
'version': '18.0.1.0.0',
'summary': "Manage Front Office Operations:Visitors, Devices Carrying"
"Register, Actions",
'description': """Helps You To Manage Front Office Operations, Odoo 17""",
'author': "Cybrosys Techno Solutions",
'maintainer': 'Cybrosys Techno Solutions',
'company': "Cybrosys Techno Solutions",
'website': "https://www.cybrosys.com",
'category': 'Industries',
'depends': ['base', 'hr'],
'data': [
'data/front_office_management_sequence.xml',
'security/fo_security.xml',
'security/ir.model.access.csv',
'views/fo_visit_views.xml',
'views/id_proof_views.xml',
'views/fo_purpose_views.xml',
'views/fo_visitor_views.xml',
'views/fo_property_counter_views.xml',
'report/front_office_management_reports.xml',
'report/property_label_templates.xml',
'report/visitor_label_templates.xml',
'report/visitors_report_templates.xml',
],
'images': ['static/description/banner.png'],
'license': 'AGPL-3',
'installable': True,
'auto_install': False,
'application': True,

}
10 changes: 10 additions & 0 deletions front_office_management/data/front_office_management_sequence.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="sequence_fo_visit" model="ir.sequence">
<field name="name">Visits</field>
<field name="code">fo.visit</field>
<field name="prefix">VID</field>
<field name="padding">3</field>
<field name="company_id" eval="False"/>
</record>
</odoo>
7 changes: 7 additions & 0 deletions front_office_management/doc/RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Module <front_office_management>

#### 07.03.2024
#### Version 17.0.1.0.0
#### ADD

- Initial commit for Front Office Management
25 changes: 25 additions & 0 deletions front_office_management/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Ammu Raj ([email protected])
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# 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 (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
from . import fo_property_counter
from . import fo_visit
from . import fo_visitor
from . import id_proof
109 changes: 109 additions & 0 deletions front_office_management/models/fo_property_counter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# -*- coding: utf-8 -*-
################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Ammu Raj ([email protected])
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# 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 (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
from odoo import api, fields, models, _
from odoo.exceptions import UserError


class FoPropertyCounter(models.Model):
"""Manages the property reaches in office"""
_name = 'fo.property.counter'
_inherit = 'mail.thread'
_description = 'Property Counter'
_rec_name = 'employee_id'

employee_id = fields.Many2one('hr.employee', string="Employee",
required=True,
help="Select the owner of the property")
date = fields.Date(string="Date", required=True,
help='The date in which property collected')
belonging_ids = fields.One2many('fo.belongings',
'property_counter_id',
string="Personal Belongings", copy=False,
help='Personal Belongings of visitor ')
state = fields.Selection([('draft', 'Draft'),
('prop_in', 'Taken In'),
('prop_out', 'Taken out'),
('cancel', 'Cancelled')],
tracking=True, default='draft',
help='If the employee gives the belongings to the'
'company change state to ""Taken In"" when'
'he/she leave office change the state to'
'""Taken out""')

def action_cancel(self):
"""For cancelling the property"""
self.state = "cancel"

def action_prop_in(self):
"""Action when taking in a property"""
count = 0
number = 0
for data in self.belonging_ids:
if not data.property_count:
raise UserError(_('Please Add the Count.'))
if data.permission == '1':
count += 1
number = data.number
if number == count:
raise UserError(_('No property can be taken in.'))
else:
self.state = 'prop_in'

def action_prop_out(self):
"""Action when taking out the property"""
self.state = "prop_out"


class FoBelongings(models.Model):
"""The details of property entered to the office"""
_name = 'fo.belongings'
_description = 'Fo Belongings'

property_name = fields.Char(string="Property",
help='The name of the Property')
property_count = fields.Char(string="Count", help='Count of property')
number = fields.Integer(compute='_compute_number', store=True, string="Sl",
help='Serial number')
visit_id = fields.Many2one('fo.visit', string="Belongings",
help='The Visitors to the Office')
property_counter_id = fields.Many2one('fo.property.counter',
string="Belongings")
permission = fields.Selection([('0', 'Allowed'),
('1', 'Not Allowed'),
('2', 'Allowed With Permission'),
], string='Permission', required=True,
index=True, default='0', tracking=True,
help='The permissions for the belongings')

@api.depends('visit_id', 'property_counter_id')
def _compute_number(self):
"""Creates serial number when adding the property"""
for visit in self.mapped('visit_id'):
number = 1
for line in visit.belonging_ids:
line.number = number
number += 1
for visit in self.mapped('property_counter_id'):
number = 1
for line in visit.belonging_ids:
line.number = number
number += 1
110 changes: 110 additions & 0 deletions front_office_management/models/fo_visit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# -*- coding: utf-8 -*-
################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Ammu Raj ([email protected])
#
# You can modify it under the terms of the GNU AFFERO
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3.
#
# 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 (AGPL v3) for more details.
#
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
# (AGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
import datetime
from odoo import api, fields, models, _


class FoVisit(models.Model):
"""Manages the details of visitors to the Office"""
_name = 'fo.visit'
_inherit = ['mail.thread']
_description = 'Visit'

name = fields.Char(string="Sequence", default=lambda self: _('New'),
help='Sequence number for the visiting')
visitor_id = fields.Many2one("fo.visitor", string='Visitor',
help='Select the visitor')
phone = fields.Char(string="Phone", required=True,
help='Phone number of the visitor')
email = fields.Char(string="Email", required=True,
help='Email of the Visitor')
reason_ids = fields.Many2many('fo.purpose', string='Purpose Of Visit',
required=True,
help='Enter the reason for visit')
belonging_ids = fields.One2many('fo.belongings',
'visit_id',
string="Personal Belongings",
help='Add the belongings details of'
'employee here.')
check_in_date = fields.Datetime(string="Check In Time", readonly=True,
help='Visitor check in time automatically'
'fills when he checked in to the'
'office')
check_out_date = fields.Datetime(string="Check Out Time", readonly=True,
help='Visitor check out time automatically'
'fills when he checked out from'
'office')
employee_id = fields.Many2one('hr.employee', string="Meeting With")
department_id = fields.Many2one('hr.department', string="Department")
state = fields.Selection([('draft', 'Draft'),
('check_in', 'Checked In'),
('check_out', 'Checked Out'),
('cancel', 'Cancelled'),
], tracking=True, default='draft',
help='Status of the visitor')

@api.model_create_multi
def create(self, vals_list):
"""Creating sequence"""
for vals in vals_list:
if not vals.get('name') or vals['name'] == _('New'):
vals['name'] = self.env['ir.sequence'].next_by_code(
'fo.visit') or _('New')
return super().create(vals_list)

def action_cancel(self):
"""Action for cancelling the visitor"""
self.state = "cancel"

def action_check_in(self):
"""Action for checking in the visitor"""
self.state = "check_in"
self.check_in_date = datetime.datetime.now()

def action_check_out(self):
"""Action for checking out the visitor"""
self.state = "check_out"
self.check_out_date = datetime.datetime.now()

@api.onchange('visitor_id')
def _onchange_visitor_id(self):
"""Selecting the"""
if self.visitor_id:
if self.visitor_id.phone:
self.phone = self.visitor_id.phone
if self.visitor_id.email:
self.email = self.visitor_id.email

@api.onchange('employee_id')
def _onchange_employee_id(self):
if self.employee_id:
self.department_id = self.employee_id.department_id


class VisitPurpose(models.Model):
_name = 'fo.purpose'
_description = 'Visit Purpose'

name = fields.Char(string='Purpose', required=True,
help='Meeting purpose in short term.eg:Meeting.')
description = fields.Text(string='Description Of Purpose',
help='Description for the Purpose.')
Loading