@ -0,0 +1,49 @@ |
|||
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg |
|||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html |
|||
:alt: License: AGPL-3 |
|||
|
|||
Equipment Request & IT Operation |
|||
==================================== |
|||
This module helps to Create Equipment Requests. |
|||
|
|||
Configuration |
|||
============= |
|||
* No additional configuration is needed. |
|||
|
|||
Company |
|||
------- |
|||
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
|||
|
|||
License |
|||
------- |
|||
Affero General Public License, v3.0 (AGPL v3). |
|||
(https://www.gnu.org/licenses/agpl-3.0-standalone.html) |
|||
|
|||
Credits |
|||
------- |
|||
* Developers: (V16) Anfas, |
|||
(V17) Mufeeda Shirin, |
|||
(V18) Aysha Shalin |
|||
Contact: odoo@cybrosys.com |
|||
|
|||
Contacts |
|||
-------- |
|||
* Mail Contact : odoo@cybrosys.com |
|||
* 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>`__ |
@ -0,0 +1,22 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Aysha Shalin (odoo@cybrosys.com) |
|||
# |
|||
# 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 |
@ -0,0 +1,50 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Aysha Shalin (odoo@cybrosys.com) |
|||
# |
|||
# 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': "Equipment Request & IT Operation", |
|||
'version': "18.0.1.0.0", |
|||
'category': 'Human Resources', |
|||
'summary': """This module helps to Create Equipment Requests.""", |
|||
'description': """This module allows employees to send equipment requests |
|||
and equipment damage expense reimbursement requests to the Department |
|||
Manager of Equipments. The workflow requires approval from the Department |
|||
Manager, followed by approval from the HR Officer for both equipment |
|||
requests and damage reimbursement requests.""", |
|||
'author': 'Cybrosys Techno Solutions', |
|||
'company': 'Cybrosys Techno Solutions', |
|||
'maintainer': 'Cybrosys Techno Solutions', |
|||
'website': 'https://www.cybrosys.com', |
|||
'depends': ['base', 'hr_expense', 'hr', 'stock', 'account'], |
|||
'data': [ |
|||
'security/ir.model.access.csv', |
|||
'security/user_groups.xml', |
|||
'views/equipment_request_views.xml', |
|||
'report/equipment_report.xml', |
|||
'report/equipment_report_template.xml', |
|||
'views/menu_action.xml', |
|||
], |
|||
'images': ['static/description/banner.png'], |
|||
'license': 'AGPL-3', |
|||
'installable': True, |
|||
'auto_install': False, |
|||
'application': False, |
|||
} |
@ -0,0 +1,6 @@ |
|||
## Module <equipment_request_it_operations> |
|||
|
|||
#### 13.12.2024 |
|||
#### Version 18.0.1.0.0 |
|||
##### ADD |
|||
- Initial commit for Equipment Request & IT Operation |
@ -0,0 +1,26 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Aysha Shalin (odoo@cybrosys.com) |
|||
# |
|||
# 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 damage_detail |
|||
from . import equipment_detail |
|||
from . import equipment_request |
|||
from . import hr_expense |
|||
from . import stock_picking |
@ -0,0 +1,59 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Aysha Shalin (odoo@cybrosys.com) |
|||
# |
|||
# 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 |
|||
|
|||
|
|||
class DamageDetail(models.Model): |
|||
""" Model to manage damages associated with expense items """ |
|||
_name = "damage.detail" |
|||
_description = "Details of expenses related to equipment damage." |
|||
_rec_name = 'product_id' |
|||
|
|||
product_id = fields.Many2one('product.product', string='Product', |
|||
help='A reference to the specific product ' |
|||
'associated with this expense item.') |
|||
unit_price = fields.Float(string='Unit Price', |
|||
help='The cost per unit of the associated ' |
|||
'product.') |
|||
quantity = fields.Float(string='Quantity', default=1, |
|||
help='The number of units of the associated product' |
|||
'that were purchased.') |
|||
expense_note = fields.Char(string='Description', |
|||
help='A brief description or' |
|||
'note about the expense item.') |
|||
equipment_damage_id = fields.Many2one('equipment.request', string='Damage', |
|||
help='A reference to the equipment ' |
|||
'request that led to this ' |
|||
'expense' |
|||
'item (if applicable).') |
|||
|
|||
@api.onchange('product_id') |
|||
def _onchange_product_id(self): |
|||
""" Changing the Product Field will give Product's Unit Price and also |
|||
resets to Quantity to 1. """ |
|||
self.unit_price = self.product_id.lst_price |
|||
self.quantity = 1 |
|||
|
|||
@api.onchange('quantity') |
|||
def _onchange_quantity(self): |
|||
""" Changing Quantity causes the Unit Price of Product to Change """ |
|||
self.unit_price = self.product_id.lst_price * self.quantity |
@ -0,0 +1,55 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Aysha Shalin (odoo@cybrosys.com) |
|||
# |
|||
# 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 |
|||
|
|||
|
|||
class EquipmentDetail(models.Model): |
|||
""" Model to manage equipment details associated with request items """ |
|||
_name = "equipment.detail" |
|||
_description = "Details of equipment associated with request items." |
|||
_rec_name = 'product_id' |
|||
|
|||
product_id = fields.Many2one('product.product', string='Product', |
|||
help='A reference to the specific product ' |
|||
'associated with this item.') |
|||
description = fields.Char(string='Description', |
|||
help='A brief description of the item.') |
|||
quantity = fields.Float(string='Quantity', default=1, |
|||
help='The number of units of the associated product' |
|||
'that were requested or used.') |
|||
product_uom_id = fields.Many2one('uom.uom', |
|||
string='Product Unit of Measure', |
|||
help='The unit of measure for the ' |
|||
'associated' |
|||
'product.') |
|||
equipment_detail_id = fields.Many2one('equipment.request', |
|||
string='Request Equipments', |
|||
help='A reference to the equipment ' |
|||
'request that led to this item ' |
|||
'(if' |
|||
'applicable).') |
|||
|
|||
@api.onchange('product_id') |
|||
def _onchange_product_id(self): |
|||
""" Changing the Product Field will reset the Quantity to 1 """ |
|||
self.quantity = 1 |
|||
self.product_uom_id = self.product_id.uom_id |
@ -0,0 +1,248 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Aysha Shalin (odoo@cybrosys.com) |
|||
# |
|||
# 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 EquipmentRequest(models.Model): |
|||
""" Model representing equipment request records. |
|||
This model stores information about equipment requests made by employees, |
|||
including details such as the type of request (software or hardware), the |
|||
employee making the request, the department, job position, user who created |
|||
the request, and other related information. |
|||
The model also includes fields to track the approval status of the request, |
|||
any damages associated with the equipment, expenses related to the request, |
|||
and internal orders associated with the request. """ |
|||
_name = "equipment.request" |
|||
_description = "Model representing equipment requests made by employees" |
|||
_inherit = ['mail.thread', 'mail.activity.mixin'] |
|||
|
|||
name = fields.Char(compute='_compute_name', |
|||
help="Auto-generated field based on record's ID") |
|||
request_for = fields.Selection([ |
|||
('software', 'Software'), |
|||
('hardware', 'Hardware')], string='Request For', |
|||
copy=False, default='software', required=True, |
|||
help="Type of Equipment Request") |
|||
employee_name_id = fields.Many2one('hr.employee', string='Employee', |
|||
required=True, |
|||
help="Employee requesting the equipment") |
|||
department_name_id = fields.Many2one('hr.department', string='Department', |
|||
help="Department of the employee") |
|||
job_position_id = fields.Many2one('hr.job', string='Job Position', |
|||
help="Job position of the employee") |
|||
user_login_id = fields.Many2one('res.users', string='User', |
|||
default=lambda self: self.env.user, |
|||
help="User who created the equipment " |
|||
"request") |
|||
damage_check = fields.Boolean(string='Damage', |
|||
help="Whether the equipment" |
|||
" is damaged or not", tracking=True) |
|||
company_name_id = fields.Many2one('res.company', string='Company', |
|||
default=lambda self: self.env.company, |
|||
help="Company of the employee") |
|||
source_location_id = fields.Many2one('stock.location', |
|||
string='Source Location', |
|||
help="Location from where the " |
|||
"equipment" |
|||
"will be sourced") |
|||
destination_location_id = fields.Many2one('stock.location', |
|||
string='Destination Location', |
|||
help="Location where the " |
|||
"equipment" |
|||
"will be sent") |
|||
created_user_id = fields.Many2one('res.users', string='Created By', |
|||
default=lambda self: self.env.user, |
|||
help="User who created the equipment " |
|||
"request") |
|||
create_date = fields.Date(string='Created Date', |
|||
help="Date when the equipment " |
|||
"request was created", tracking=True) |
|||
validate_user_id = fields.Many2one('res.users', string='Department Manager', |
|||
help="Manager who approves the equipment" |
|||
"request") |
|||
validate_date = fields.Date(string='Department Approved Date', |
|||
help="Date when the department manager approved" |
|||
"the equipment request") |
|||
hr_user_id = fields.Many2one('res.users', string='HR Manager', |
|||
help="HR Manager who approves the equipment " |
|||
"request") |
|||
hr_date = fields.Date(string='HR Approved Date', |
|||
help="Date when the HR Manager approved the equipment" |
|||
"request") |
|||
stock_user_id = fields.Many2one('res.users', string='Stock Manager', |
|||
help="Stock Manager who approves the " |
|||
"equipment" |
|||
"request") |
|||
stock_date = fields.Date(string='Stock Approved Date', |
|||
help="Date when the Stock Manager approved the " |
|||
"equipment request") |
|||
status = fields.Selection([ |
|||
('draft', 'Draft'), |
|||
('waiting', 'Waiting for Approval of Department'), |
|||
('approval', 'Waiting For Approval of HR'), |
|||
('approved', 'Approved'), |
|||
('assigned', 'Equipment Assigned'), |
|||
('reject', 'Rejected')], |
|||
string='State', copy=False, default='draft', |
|||
help="Status of the equipment request", tracking=True) |
|||
is_expensed = fields.Boolean(default=False, |
|||
help="Whether the equipment request has been " |
|||
"expensed or not") |
|||
equipment_request_ids = fields.One2many('equipment.detail', |
|||
'equipment_detail_id', |
|||
string='Request Equipments', |
|||
help="Equipment details for the " |
|||
"equipment request") |
|||
equipment_damage_ids = fields.One2many('damage.detail', |
|||
'equipment_damage_id', |
|||
string='Damage Details', |
|||
help="Details of damages (if any) " |
|||
"for" |
|||
"the equipment") |
|||
equipment_expense_ids = fields.One2many('hr.expense', |
|||
'equipment_expense_id', |
|||
string='Expenses', |
|||
help="Expenses (if any) associated " |
|||
"with the equipment request") |
|||
equipment_internal_ids = fields.One2many('stock.picking', |
|||
'equipment_transfer_id', |
|||
string='Internal Orders', |
|||
help="The internal orders " |
|||
"related to" |
|||
"this equipment request.") |
|||
|
|||
@api.onchange('employee_name_id') |
|||
def _onchange_employee_name_id(self): |
|||
""" Changing the Employee will also write the Department he belongs to |
|||
and also Job Position. """ |
|||
if self.employee_name_id: |
|||
self.department_name_id = self.employee_name_id.department_id |
|||
self.job_position_id = self.employee_name_id.job_id |
|||
|
|||
@api.depends('request_for', 'employee_name_id') |
|||
def _compute_name(self): |
|||
""" _rec_name = Employee Name + Request Type + Creation Date""" |
|||
for record in self: |
|||
record.name = str(record.employee_name_id.name) + ' - ' + str( |
|||
record.request_for) + ' - ' + str( |
|||
fields.date.today()) |
|||
|
|||
def action_confirm(self): |
|||
""" Confirm Button """ |
|||
self.write({'status': 'waiting'}) |
|||
|
|||
def action_reject(self): |
|||
""" Reject Button """ |
|||
self.write({'status': 'reject'}) |
|||
|
|||
def action_waiting_approval_dept(self): |
|||
""" Department Approval Button also write the user who Approved this |
|||
button and Date he approved. """ |
|||
self.write({'status': 'approval', 'validate_user_id': self.env.user.id, |
|||
'validate_date': fields.Date.today()}) |
|||
|
|||
def action_waiting_approval_hr(self): |
|||
""" HR Approval Button also write the user who Approved this button |
|||
and Date he approved. """ |
|||
self.write({'status': 'approved', 'hr_user_id': self.env.user.id, |
|||
'hr_date': fields.Date.today()}) |
|||
|
|||
def action_internal_transfer(self): |
|||
""" Create Internal Transfer and Go the Final Status if no source |
|||
location and destination location User Error Shows. """ |
|||
if not self.source_location_id: |
|||
raise UserError(_('Source Location is not defined')) |
|||
if not self.destination_location_id: |
|||
raise UserError(_('Destination Location is not defined')) |
|||
picking_type_id = self.env['stock.picking.type'].search( |
|||
[('code', '=', 'internal')]) |
|||
if not picking_type_id: |
|||
picking_type_id = self.env['stock.picking.type'].create({ |
|||
'name': 'Internal Transfers', |
|||
'code': 'internal', |
|||
'sequence_code': 'INT', |
|||
}) |
|||
move_vals = { |
|||
'picking_type_id': picking_type_id.id, |
|||
'location_id': self.source_location_id.id, |
|||
'location_dest_id': self.destination_location_id.id, |
|||
'equipment_transfer_id': self.id, |
|||
} |
|||
picking = self.env['stock.picking'].create(move_vals) |
|||
for value in self.equipment_request_ids: |
|||
self.env['stock.move'].create({ |
|||
'picking_id': picking.id, |
|||
'name': value.product_id.name, |
|||
'product_id': value.product_id.id, |
|||
'product_uom_qty': value.quantity, |
|||
'product_uom': value.product_id.uom_id.id, |
|||
'location_id': self.source_location_id.id, |
|||
'location_dest_id': self.destination_location_id.id, |
|||
}) |
|||
picking.action_confirm() |
|||
picking.action_assign() |
|||
self.write({'status': 'assigned', 'stock_user_id': self.env.user.id, |
|||
'stock_date': fields.Date.today()}) |
|||
|
|||
def action_expense(self): |
|||
""" Button of Create Expense And will Create Expense in Expense Module """ |
|||
if self.equipment_damage_ids: |
|||
for value in self.equipment_damage_ids: |
|||
self.env['hr.expense'].create({ |
|||
'total_amount': value.unit_price, |
|||
'name': self.name, |
|||
'employee_id': self.employee_name_id.id, |
|||
'product_id': value.product_id.id, |
|||
'equipment_expense_id': self.id, |
|||
}) |
|||
self.is_expensed = True |
|||
|
|||
def action_smart_expense(self): |
|||
""" View the Expense in the Smart Tab and also can Approve it from the |
|||
Smart Tab. """ |
|||
return { |
|||
'type': 'ir.actions.act_window', |
|||
'name': 'Expense', |
|||
'res_model': 'hr.expense', |
|||
'target': 'current', |
|||
'domain': [('name', '=', self.name), |
|||
('employee_id', '=', self.employee_name_id.id), |
|||
('equipment_expense_id', '=', self.id)], |
|||
'view_mode': 'list,form', |
|||
} |
|||
|
|||
def action_view_internal_transfer(self): |
|||
""" View Current Record of the Internal Transfer Button """ |
|||
picking_id = self.env['stock.picking'].search([ |
|||
('picking_type_id.code', '=', 'internal'), |
|||
('location_id', '=', self.source_location_id.id), |
|||
('location_dest_id', '=', self.destination_location_id.id), |
|||
], limit=1, order='create_date desc') |
|||
return { |
|||
'type': 'ir.actions.act_window', |
|||
'name': 'Internal Transfer', |
|||
'view_mode': 'form', |
|||
'target': 'current', |
|||
'res_model': 'stock.picking', |
|||
'res_id': picking_id.id |
|||
} |
@ -0,0 +1,36 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Aysha Shalin (odoo@cybrosys.com) |
|||
# |
|||
# 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 fields, models |
|||
|
|||
|
|||
class HrExpense(models.Model): |
|||
""" |
|||
Model representing expenses associated with equipment requests. |
|||
This model inherits from the `hr.expense` model and adds a Many2one field |
|||
`equipment_expense_id` to link expenses with equipment requests. This field |
|||
is used to associate expenses with the corresponding equipment request. |
|||
""" |
|||
_inherit = "hr.expense" |
|||
|
|||
equipment_expense_id = fields.Many2one('equipment.request', |
|||
string='Equipment', |
|||
help="Link to creating expense based on damages in equipment request") |
@ -0,0 +1,37 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Aysha Shalin (odoo@cybrosys.com) |
|||
# |
|||
# 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 fields, models |
|||
|
|||
|
|||
class StockPicking(models.Model): |
|||
""" |
|||
Model representing internal transfers related to equipment requests. |
|||
This model inherits from the `stock.picking` model and adds a Many2one field |
|||
`equipment_transfer_id` to link internal transfers with equipment requests. |
|||
This field is used to associate internal transfers with the corresponding |
|||
equipment request. |
|||
""" |
|||
_inherit = 'stock.picking' |
|||
|
|||
equipment_transfer_id = fields.Many2one('equipment.request', |
|||
string='Equipment', |
|||
help="link internal transfers with equipment requests") |
@ -0,0 +1,13 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<odoo> |
|||
<!-- Report Function inside Equipment Request Form --> |
|||
<record id="equipment_request_report" model="ir.actions.report"> |
|||
<field name="name">Equipment Report</field> |
|||
<field name="model">equipment.request</field> |
|||
<field name="report_type">qweb-pdf</field> |
|||
<field name="report_name">equipment_request_it_operations.report_equipment_request_details</field> |
|||
<field name="report_file">equipment_request_it_operations.report_equipment_request_details</field> |
|||
<field name="binding_model_id" ref="model_equipment_request"/> |
|||
<field name="binding_type">report</field> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,240 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Report Template --> |
|||
<template id="report_equipment_request_details"> |
|||
<t t-call="web.html_container"> |
|||
<t t-foreach="docs" t-as="data"> |
|||
<t t-call="web.external_layout"> |
|||
<div class="page"> |
|||
<div class="oe_structure"/> |
|||
<div class="text-center"> |
|||
<h1> |
|||
<u>Equipment Report</u> |
|||
</h1> |
|||
</div> |
|||
<br> |
|||
</br> |
|||
<h3>Equipment Assigns</h3> |
|||
<table class="table table-sm" |
|||
style="border: 1px solid black;"> |
|||
<tr> |
|||
<td> |
|||
<strong>Created By:</strong> |
|||
</td> |
|||
<td> |
|||
<t t-esc="data.created_user_id.name"/> |
|||
</td> |
|||
<td> |
|||
<strong>Created Date:</strong> |
|||
</td> |
|||
<td> |
|||
<t t-esc="data.create_date"/> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td> |
|||
<strong>Dept Manager:</strong> |
|||
</td> |
|||
<td> |
|||
<t t-esc="data.validate_user_id.name"/> |
|||
</td> |
|||
<td> |
|||
<strong>Dept Manager Approved Date: |
|||
</strong> |
|||
</td> |
|||
<td> |
|||
<t t-esc="data.validate_date"/> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td> |
|||
<strong>HR Manager:</strong> |
|||
</td> |
|||
<td> |
|||
<t t-esc="data.hr_user_id.name"/> |
|||
</td> |
|||
<td> |
|||
<strong>HR Manager Approved Date:</strong> |
|||
</td> |
|||
<td> |
|||
<t t-esc="data.hr_date"/> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td> |
|||
<strong>Stock Manager:</strong> |
|||
</td> |
|||
<td> |
|||
<t t-esc="data.stock_user_id.name"/> |
|||
</td> |
|||
<td> |
|||
<strong>Stock Manager Approved Date: |
|||
</strong> |
|||
</td> |
|||
<td> |
|||
<t t-esc="data.stock_date"/> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
<br> |
|||
</br> |
|||
<h3>Request Equipment Details</h3> |
|||
<style> |
|||
table, thead, th, td, tr, tbody { |
|||
border: 1px solid black; |
|||
border-collapse: collapse; |
|||
padding: 5px; |
|||
} |
|||
</style> |
|||
<table class="table table-sm" |
|||
style="border: 2px solid black;"> |
|||
<thead> |
|||
<tr> |
|||
<strong> |
|||
<th>Sl.No</th> |
|||
<th>Product</th> |
|||
<th>Description</th> |
|||
<th>Quantity</th> |
|||
<th>Unit of Measure</th> |
|||
</strong> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<t t-set="i" t-value="1"/> |
|||
<t t-foreach="data.equipment_request_ids" |
|||
t-as="request"> |
|||
<tr> |
|||
<th scope="row"> |
|||
<t t-esc="i"/> |
|||
</th> |
|||
<td> |
|||
<t t-esc="request.product_id.name"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="request.description"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="request.quantity"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="request.product_uom_id.name"/> |
|||
</td> |
|||
</tr> |
|||
<t t-set="i" t-value="i+1"/> |
|||
</t> |
|||
</tbody> |
|||
</table> |
|||
<br> |
|||
</br> |
|||
<t t-if="data.equipment_damage_ids"> |
|||
<h3>Damage Details</h3> |
|||
<style> |
|||
table, thead, th, td, tr, tbody { |
|||
border: 1px solid black; |
|||
border-collapse: collapse; |
|||
padding: 5px; |
|||
} |
|||
</style> |
|||
<table class="table table-sm" |
|||
style="border: 2px solid black;"> |
|||
<thead> |
|||
<tr> |
|||
<strong> |
|||
<th>Sl.No</th> |
|||
<th>Product</th> |
|||
<th>Quantity</th> |
|||
<th>Unit Price</th> |
|||
<th>Description</th> |
|||
</strong> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<t t-set="i" t-value="1"/> |
|||
<t t-foreach="data.equipment_damage_ids" |
|||
t-as="damage"> |
|||
<tr> |
|||
<th scope="row"> |
|||
<t t-esc="i"/> |
|||
</th> |
|||
<td> |
|||
<t t-esc="damage.product_id.name"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="damage.quantity"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="damage.unit_price"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="damage.expense_note"/> |
|||
</td> |
|||
</tr> |
|||
<t t-set="i" t-value="i+1"/> |
|||
</t> |
|||
</tbody> |
|||
</table> |
|||
</t> |
|||
<br> |
|||
</br> |
|||
<t t-if="data.equipment_damage_ids"> |
|||
<h3>Expense List</h3> |
|||
<style> |
|||
table, thead, th, td, tr, tbody { |
|||
border: 1px solid black; |
|||
border-collapse: collapse; |
|||
padding: 5px; |
|||
} |
|||
</style> |
|||
<table class="table table-sm" |
|||
style="border: 2px solid black;"> |
|||
<thead> |
|||
<tr> |
|||
<strong> |
|||
<th>Sl.No</th> |
|||
<th>Expense Date</th> |
|||
<th>Description</th> |
|||
<th>Employee</th> |
|||
<th>Category</th> |
|||
<th>Total</th> |
|||
<th>Status</th> |
|||
</strong> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<t t-set="i" t-value="1"/> |
|||
<t t-foreach="data.equipment_expense_ids" |
|||
t-as="expense"> |
|||
<tr> |
|||
<th scope="row"> |
|||
<t t-esc="i"/> |
|||
</th> |
|||
<td> |
|||
<t t-esc="expense.date.strftime('%d/%m/%Y')"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="expense.name"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="expense.employee_id.name"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="expense.product_id.name"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="expense.total_amount"/> |
|||
</td> |
|||
<td> |
|||
<t t-esc="expense.state"/> |
|||
</td> |
|||
</tr> |
|||
<t t-set="i" t-value="i+1"/> |
|||
</t> |
|||
</tbody> |
|||
</table> |
|||
</t> |
|||
</div> |
|||
</t> |
|||
</t> |
|||
</t> |
|||
</template> |
|||
</odoo> |
|
@ -0,0 +1,30 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<!-- Access Levels --> |
|||
<record model="ir.module.category" id="module_equipment_request_it_operations"> |
|||
<field name="name">Equipments</field> |
|||
<field name="description">Access Levels</field> |
|||
</record> |
|||
<!-- Equipment_department_manager_res_group --> |
|||
<record id="equipment_request_it_operations_group_department_manager" model="res.groups"> |
|||
<field name="name">Department Manager</field> |
|||
<field name="category_id" ref="module_equipment_request_it_operations"/> |
|||
</record> |
|||
<!-- Equipment_hr_officer_res_group --> |
|||
<record id="equipment_request_it_operations_group_hr_officer" model="res.groups"> |
|||
<field name="name">HR Officer</field> |
|||
<field name="category_id" ref="module_equipment_request_it_operations"/> |
|||
</record> |
|||
<!-- Equipment_stock_manager_res_group --> |
|||
<record id="equipment_request_it_operations_group_stock_manager" model="res.groups"> |
|||
<field name="name">Stock Manager</field> |
|||
<field name="category_id" ref="module_equipment_request_it_operations"/> |
|||
</record> |
|||
<!-- Admin_res_group --> |
|||
<record id="equipment_request_it_operations_group_admin" model="res.groups"> |
|||
<field name="name">Manager</field> |
|||
<field name="category_id" ref="module_equipment_request_it_operations"/> |
|||
<field name="implied_ids" |
|||
eval="[(4, ref('equipment_request_it_operations_group_department_manager')),(4, ref('equipment_request_it_operations_group_stock_manager')), (4, ref('equipment_request_it_operations_group_hr_officer'))]"/> |
|||
</record> |
|||
</odoo> |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 628 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 210 KiB |
After Width: | Height: | Size: 209 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 495 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 214 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 542 B |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 926 B |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 189 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 875 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 145 KiB |
After Width: | Height: | Size: 138 KiB |
After Width: | Height: | Size: 130 KiB |
After Width: | Height: | Size: 92 KiB |
After Width: | Height: | Size: 126 KiB |
After Width: | Height: | Size: 135 KiB |
After Width: | Height: | Size: 93 KiB |
After Width: | Height: | Size: 113 KiB |
After Width: | Height: | Size: 45 KiB |
After Width: | Height: | Size: 127 KiB |
After Width: | Height: | Size: 61 KiB |
After Width: | Height: | Size: 144 KiB |
After Width: | Height: | Size: 63 KiB |
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 104 KiB |
After Width: | Height: | Size: 116 KiB |
After Width: | Height: | Size: 45 KiB |
After Width: | Height: | Size: 102 KiB |
After Width: | Height: | Size: 112 KiB |