@ -0,0 +1,49 @@ |
|||
.. 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 |
|||
|
|||
Employee Purchase Requisition |
|||
============================= |
|||
* Employee Purchase Requisition Module for Odoo 17 |
|||
|
|||
Installation |
|||
============ |
|||
- www.odoo.com/documentation/17.0/setup/install.html |
|||
- Install our custom addon |
|||
|
|||
License |
|||
------- |
|||
Affero General Public License v3.0 (AGPL v3) |
|||
(https://www.gnu.org/licenses/agpl-3.0-standalone.html) |
|||
|
|||
Company |
|||
------- |
|||
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
|||
|
|||
Credits |
|||
------- |
|||
* Developer : Developer : (V17) Ashok P K |
|||
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 https://www.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: Ashok PK (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,58 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Ashok PK (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': 'Employee Purchase Requisition', |
|||
'version': '17.0.1.0.0', |
|||
'category': 'Purchases', |
|||
'summary': 'Manage material requisition of employees and user', |
|||
'description': """Create the material requisition request and there are |
|||
multi-level approvals for requests from the department head and requisition |
|||
manager. Department head has the option to choose vendors for each material. |
|||
Also we can generate the PDF report for each material requisition""", |
|||
'author': 'Cybrosys Techno Solutions', |
|||
'company': 'Cybrosys Techno Solutions', |
|||
'maintainer': 'Cybrosys Techno Solutions', |
|||
'website': 'https://www.cybrosys.com', |
|||
'depends': ['base', 'hr', 'stock', 'purchase'], |
|||
'data': [ |
|||
'security/employee_purchase_requisition_groups.xml', |
|||
'security/employee_purchase_requisition_security.xml', |
|||
'security/ir.model.access.csv', |
|||
'data/ir_sequence_data.xml', |
|||
'views/employee_purchase_requisition_views.xml', |
|||
'views/requisition_order_views.xml', |
|||
'views/employee_purchase_requisition_menu.xml', |
|||
'views/hr_employee_views.xml', |
|||
'views/hr_department_views.xml', |
|||
'views/purchase_order_views.xml', |
|||
'views/stock_picking_views.xml', |
|||
'views/employee_purchase_requisition_actions.xml', |
|||
'report/employee_purchase_requisition_templates.xml', |
|||
'report/employee_purchase_requisition_report.xml', |
|||
], |
|||
'images': ['static/description/banner.png'], |
|||
'license': 'AGPL-3', |
|||
'installable': True, |
|||
'auto_install': False, |
|||
'application': True, |
|||
} |
|||
|
@ -0,0 +1,15 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<data noupdate="1"> |
|||
<!-- sequence for employee purchase requisition --> |
|||
<record id="sequence_purchase_requisition" model="ir.sequence"> |
|||
<field name="name">Employee Purchase Requisition</field> |
|||
<field name="code">employee.purchase.requisition</field> |
|||
<field name="prefix">EPR</field> |
|||
<field name="padding">5</field> |
|||
<field eval="1" name="number_next"/> |
|||
<field eval="1" name="number_increment"/> |
|||
<field eval="False" name="company_id"/> |
|||
</record> |
|||
</data> |
|||
</odoo> |
@ -0,0 +1,6 @@ |
|||
## Module <employee_purchase_requisition> |
|||
|
|||
#### 24.01.2024 |
|||
#### Version 17.0.1.0.0 |
|||
#### ADD |
|||
- Initial commit for Employee Purchase Requisition |
@ -0,0 +1,27 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Ashok PK (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 employee_purchase_requisition |
|||
from . import hr_department |
|||
from . import hr_employee |
|||
from . import purchase_order |
|||
from . import requisition_order |
|||
from . import stock_picking |
@ -0,0 +1,262 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Ashok PK (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 ValidationError |
|||
|
|||
|
|||
class PurchaseRequisition(models.Model): |
|||
"""Class for adding fields and functions for purchase requisition model.""" |
|||
_name = 'employee.purchase.requisition' |
|||
_description = 'Employee Purchase Requisition' |
|||
_inherit = "mail.thread", "mail.activity.mixin" |
|||
|
|||
name = fields.Char( |
|||
string="Reference No", readonly=True) |
|||
employee_id = fields.Many2one( |
|||
comodel_name='hr.employee', string='Employee', |
|||
required=True, help='Select an employee') |
|||
dept_id = fields.Many2one( |
|||
comodel_name='hr.department', string='Department', |
|||
related='employee_id.department_id', store=True, |
|||
help='Select an department') |
|||
user_id = fields.Many2one( |
|||
comodel_name='res.users', |
|||
string='Responsible', |
|||
required=True, |
|||
domain=lambda self: [('share', '=', False), ('id', '!=', self.env.uid)], |
|||
help='Select a user who is responsible for requisition') |
|||
requisition_date = fields.Date( |
|||
string="Requisition Date", |
|||
default=lambda self: fields.Date.today(), |
|||
help='Date of requisition') |
|||
receive_date = fields.Date( |
|||
string="Received Date", readonly=True, |
|||
help='Received date') |
|||
requisition_deadline = fields.Date( |
|||
string="Requisition Deadline", |
|||
help="End date of purchase requisition") |
|||
company_id = fields.Many2one( |
|||
comodel_name='res.company', string='Company', |
|||
default=lambda self: self.env.company, |
|||
help='Select a company') |
|||
requisition_order_ids = fields.One2many( |
|||
comodel_name='requisition.order', |
|||
inverse_name='requisition_product_id', |
|||
required=True) |
|||
confirm_id = fields.Many2one( |
|||
comodel_name='res.users', |
|||
string='Confirmed By', |
|||
default=lambda self: self.env.uid, |
|||
readonly=True, |
|||
help='User who confirmed the requisition.') |
|||
manager_id = fields.Many2one( |
|||
comodel_name='res.users', |
|||
string='Department Manager', |
|||
readonly=True, help='Select a department manager') |
|||
requisition_head_id = fields.Many2one( |
|||
comodel_name='res.users', |
|||
string='Approved By', |
|||
readonly=True, |
|||
help='User who approved the requisition.') |
|||
rejected_user_id = fields.Many2one( |
|||
comodel_name='res.users', |
|||
string='Rejected By', |
|||
readonly=True, |
|||
help='User who rejected the requisition') |
|||
confirmed_date = fields.Date( |
|||
string='Confirmed Date', readonly=True, |
|||
help='Date of requisition confirmation') |
|||
department_approval_date = fields.Date( |
|||
string='Department Approval Date', |
|||
readonly=True, |
|||
help='Department approval date') |
|||
approval_date = fields.Date( |
|||
string='Approved Date', readonly=True, |
|||
help='Requisition approval date') |
|||
reject_date = fields.Date( |
|||
string='Rejection Date', readonly=True, |
|||
help='Requisition rejected date') |
|||
source_location_id = fields.Many2one( |
|||
comodel_name='stock.location', |
|||
string='Source Location', |
|||
help='Source location of requisition.') |
|||
destination_location_id = fields.Many2one( |
|||
comodel_name='stock.location', |
|||
string="Destination Location", |
|||
help='Destination location of requisition.') |
|||
delivery_type_id = fields.Many2one( |
|||
comodel_name='stock.picking.type', |
|||
string='Delivery To', |
|||
help='Type of delivery.') |
|||
internal_picking_id = fields.Many2one( |
|||
comodel_name='stock.picking.type', |
|||
string="Internal Picking") |
|||
requisition_description = fields.Text( |
|||
string="Reason For Requisition") |
|||
purchase_count = fields.Integer( |
|||
string='Purchase Count', |
|||
help='Purchase count', |
|||
compute='_compute_purchase_count') |
|||
internal_transfer_count = fields.Integer( |
|||
string='Internal Transfer count', |
|||
help='Internal transfer count', |
|||
compute='_compute_internal_transfer_count') |
|||
state = fields.Selection( |
|||
[('new', 'New'), |
|||
('waiting_department_approval', 'Waiting Department Approval'), |
|||
('waiting_head_approval', 'Waiting Head Approval'), |
|||
('approved', 'Approved'), |
|||
('purchase_order_created', 'Purchase Order Created'), |
|||
('received', 'Received'), |
|||
('cancelled', 'Cancelled')], |
|||
default='new', copy=False, tracking=True) |
|||
|
|||
@api.model |
|||
def create(self, vals): |
|||
"""Function to generate purchase requisition sequence""" |
|||
if vals.get('name', 'New') == 'New': |
|||
vals['name'] = self.env['ir.sequence'].next_by_code( |
|||
'employee.purchase.requisition') or 'New' |
|||
result = super(PurchaseRequisition, self).create(vals) |
|||
return result |
|||
|
|||
def action_confirm_requisition(self): |
|||
"""Function to confirm purchase requisition""" |
|||
self.source_location_id = ( |
|||
self.employee_id.department_id.department_location_id.id) if ( |
|||
self.employee_id.department_id.department_location_id) else ( |
|||
self.env.ref('stock.stock_location_stock').id) |
|||
self.destination_location_id = ( |
|||
self.employee_id.employee_location_id.id) if ( |
|||
self.employee_id.employee_location_id) else ( |
|||
self.env.ref('stock.stock_location_stock').id) |
|||
self.delivery_type_id = ( |
|||
self.source_location_id.warehouse_id.in_type_id.id) |
|||
self.internal_picking_id = ( |
|||
self.source_location_id.warehouse_id.int_type_id.id) |
|||
self.write({'state': 'waiting_department_approval'}) |
|||
self.confirm_id = self.env.uid |
|||
self.confirmed_date = fields.Date.today() |
|||
|
|||
def action_department_approval(self): |
|||
"""Approval from department""" |
|||
for rec in self.requisition_order_ids: |
|||
if rec.requisition_type == 'purchase_order' and not rec.partner_id: |
|||
raise ValidationError('Select a vendor') |
|||
self.write({'state': 'waiting_head_approval'}) |
|||
self.manager_id = self.env.uid |
|||
self.department_approval_date = fields.Date.today() |
|||
|
|||
def action_department_cancel(self): |
|||
"""Cancellation from department """ |
|||
self.write({'state': 'cancelled'}) |
|||
self.rejected_user_id = self.env.uid |
|||
self.reject_date = fields.Date.today() |
|||
|
|||
def action_head_approval(self): |
|||
"""Approval from department head""" |
|||
self.write({'state': 'approved'}) |
|||
self.requisition_head_id = self.env.uid |
|||
self.approval_date = fields.Date.today() |
|||
|
|||
def action_head_cancel(self): |
|||
"""Cancellation from department head""" |
|||
self.write({'state': 'cancelled'}) |
|||
self.rejected_user_id = self.env.uid |
|||
self.reject_date = fields.Date.today() |
|||
|
|||
def action_create_purchase_order(self): |
|||
"""Create purchase order and internal transfer""" |
|||
for rec in self.requisition_order_ids: |
|||
if rec.requisition_type == 'internal_transfer': |
|||
self.env['stock.picking'].create({ |
|||
'location_id': self.source_location_id.id, |
|||
'location_dest_id': self.destination_location_id.id, |
|||
'picking_type_id': self.internal_picking_id.id, |
|||
'requisition_order': self.name, |
|||
'move_ids_without_package': [(0, 0, { |
|||
'name': rec.product_id.name, |
|||
'product_id': rec.product_id.id, |
|||
'product_uom': rec.product_id.uom_id.id, |
|||
'product_uom_qty': rec.quantity, |
|||
'location_id': self.source_location_id.id, |
|||
'location_dest_id': self.destination_location_id.id, |
|||
})] |
|||
}) |
|||
else: |
|||
self.env['purchase.order'].create({ |
|||
'partner_id': rec.partner_id.id, |
|||
'requisition_order': self.name, |
|||
"order_line": [(0, 0, { |
|||
'product_id': rec.product_id.id, |
|||
'product_qty': rec.quantity, |
|||
})]}) |
|||
self.write({'state': 'purchase_order_created'}) |
|||
|
|||
def _compute_internal_transfer_count(self): |
|||
"""Function to compute the transfer count""" |
|||
self.internal_transfer_count = self.env['stock.picking'].search_count([ |
|||
('requisition_order', '=', self.name)]) |
|||
|
|||
def _compute_purchase_count(self): |
|||
"""Function to compute the purchase count""" |
|||
self.purchase_count = self.env['purchase.order'].search_count([ |
|||
('requisition_order', '=', self.name)]) |
|||
|
|||
def action_receive(self): |
|||
"""Received purchase requisition""" |
|||
self.write({'state': 'received'}) |
|||
self.receive_date = fields.Date.today() |
|||
|
|||
def get_purchase_order(self): |
|||
"""Purchase order smart button view""" |
|||
self.ensure_one() |
|||
return { |
|||
'type': 'ir.actions.act_window', |
|||
'name': 'Purchase Order', |
|||
'view_mode': 'tree,form', |
|||
'res_model': 'purchase.order', |
|||
'domain': [('requisition_order', '=', self.name)], |
|||
} |
|||
|
|||
def get_internal_transfer(self): |
|||
"""Internal transfer smart tab view""" |
|||
self.ensure_one() |
|||
return { |
|||
'type': 'ir.actions.act_window', |
|||
'name': 'Internal Transfers', |
|||
'view_mode': 'tree,form', |
|||
'res_model': 'stock.picking', |
|||
'domain': [('requisition_order', '=', self.name)], |
|||
} |
|||
|
|||
def action_print_report(self): |
|||
"""Print purchase requisition report""" |
|||
data = { |
|||
'employee': self.employee_id.name, |
|||
'records': self.read(), |
|||
'order_ids': self.requisition_order_ids.read(), |
|||
} |
|||
return (self.env.ref( |
|||
'employee_purchase_requisition.' |
|||
'action_report_purchase_requisition').report_action( |
|||
self, data=data)) |
@ -0,0 +1,33 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Ashok PK (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 Department(models.Model): |
|||
""" Class for adding new field in employee department""" |
|||
|
|||
_inherit = 'hr.department' |
|||
|
|||
department_location_id = fields.Many2one( |
|||
comodel_name='stock.location', |
|||
string='Destination Location', |
|||
help='Select a department location from the list of locations.') |
@ -0,0 +1,33 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Ashok PK (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 HrEmployeePrivate(models.Model): |
|||
"""Class to add new field in employee form""" |
|||
|
|||
_inherit = 'hr.employee' |
|||
|
|||
employee_location_id = fields.Many2one( |
|||
comodel_name='stock.location', |
|||
string="Destination Location", |
|||
help='Select a employee location from the location list') |
@ -0,0 +1,32 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Ashok PK (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 PurchaseOrder(models.Model): |
|||
"""Class to add new field in purchase order""" |
|||
|
|||
_inherit = 'purchase.order' |
|||
|
|||
requisition_order = fields.Char( |
|||
string='Requisition Order', |
|||
help='Set a requisition Order') |
@ -0,0 +1,72 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Ashok PK (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 RequisitionProducts(models.Model): |
|||
_name = 'requisition.order' |
|||
_description = 'Requisition order' |
|||
|
|||
requisition_product_id = fields.Many2one( |
|||
comodel_name='employee.purchase.requisition', |
|||
help='Requisition product.') |
|||
state = fields.Selection( |
|||
string='State', |
|||
related='requisition_product_id.state') |
|||
requisition_type = fields.Selection( |
|||
string='Requisition Type', |
|||
selection=[('purchase_order', 'Purchase Order'), |
|||
('internal_transfer', 'Internal Transfer'), ], |
|||
help='Type of requisition', required=True, default='purchase_order') |
|||
product_id = fields.Many2one( |
|||
comodel_name='product.product', required=True, |
|||
help='Product') |
|||
description = fields.Text( |
|||
string="Description", |
|||
compute='_compute_name', |
|||
store=True, readonly=False, |
|||
precompute=True, help='Product description') |
|||
quantity = fields.Integer( |
|||
string='Quantity', help='Product quantity') |
|||
uom = fields.Char( |
|||
related='product_id.uom_id.name', |
|||
string='Unit of Measure', help='Product unit of measure') |
|||
partner_id = fields.Many2one( |
|||
comodel_name='res.partner', string='Vendor', |
|||
help='Vendor for the requisition',readonly=False) |
|||
|
|||
@api.depends('product_id') |
|||
def _compute_name(self): |
|||
"""Compute product description""" |
|||
for option in self: |
|||
if not option.product_id: |
|||
continue |
|||
product_lang = option.product_id.with_context( |
|||
lang=self.requisition_product_id.employee_id.lang) |
|||
option.description = product_lang.get_product_multiline_description_sale() |
|||
|
|||
@api.onchange('requisition_type') |
|||
def _onchange_product(self): |
|||
"""Fetching product vendors""" |
|||
vendors_list = [data.partner_id.id for data in |
|||
self.product_id.seller_ids] |
|||
return {'domain': {'partner_id': [('id', 'in', vendors_list)]}} |
@ -0,0 +1,32 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Ashok PK (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 Picking(models.Model): |
|||
"""Class to add new field in stock picking""" |
|||
|
|||
_inherit = 'stock.picking' |
|||
|
|||
requisition_order = fields.Char( |
|||
string='Requisition Order', |
|||
help='Requisition order sequence') |
@ -0,0 +1,11 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<!--purchase requisition report--> |
|||
<record id="action_report_purchase_requisition" model="ir.actions.report"> |
|||
<field name="name">Material Purchase Requisition Report</field> |
|||
<field name="model">employee.purchase.requisition</field> |
|||
<field name="report_type">qweb-pdf</field> |
|||
<field name="report_name">employee_purchase_requisition.report_purchase_requisition</field> |
|||
<field name="report_file">employee_purchase_requisition.report_purchase_requisition</field> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,208 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<!-- purchase requisition report template--> |
|||
<template id="report_purchase_requisition"> |
|||
<t t-call="web.external_layout"> |
|||
<t t-call="web.html_container"> |
|||
<div class="page"> |
|||
<t t-foreach="records" t-as="rec"> |
|||
<h5>Purchase Requisition : |
|||
<t t-if="rec['name']"> |
|||
<t t-esc="rec['name']"/> |
|||
</t> |
|||
</h5> |
|||
<table class="table table-striped"> |
|||
<tr> |
|||
<th>Employee</th> |
|||
<td> |
|||
<t t-if="rec['employee_id']"> |
|||
<t t-esc="rec['employee_id'][1]"/> |
|||
</t> |
|||
</td> |
|||
<th>Requisition Date</th> |
|||
<td> |
|||
<t t-if="rec['employee_id']"> |
|||
<t t-esc="rec['requisition_date']"/> |
|||
</t> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<th>Department</th> |
|||
<td> |
|||
<t t-if="rec['dept_id']"> |
|||
<t t-esc="rec['dept_id'][1]"/> |
|||
</t> |
|||
</td> |
|||
<th>Received Date</th> |
|||
<td> |
|||
<t t-if="rec['receive_date']"> |
|||
<t t-esc="rec['receive_date']"/> |
|||
</t> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<th>Requisition Responsible</th> |
|||
<td> |
|||
<t t-if="rec['user_id']"> |
|||
<t t-esc="rec['user_id'][1]"/> |
|||
</t> |
|||
</td> |
|||
<th>Requisition Deadline</th> |
|||
<td> |
|||
<t t-if="rec['requisition_deadline']"> |
|||
<t t-esc="rec['requisition_deadline']"/> |
|||
</t> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<th>Company</th> |
|||
<td> |
|||
<t t-if="rec['company_id']"> |
|||
<t t-esc="rec['company_id'][1]"/> |
|||
</t> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
<h5>Other Information</h5> |
|||
<table class="table table-sm"> |
|||
<tr> |
|||
<th>Confirmed By</th> |
|||
<td> |
|||
<t t-if="rec['confirm_id']"> |
|||
<t t-esc="rec['confirm_id'][1]"/> |
|||
</t> |
|||
</td> |
|||
<th>Confirmed Date</th> |
|||
<td> |
|||
<t t-if="rec['confirmed_date']"> |
|||
<t t-esc="rec['confirmed_date']"/> |
|||
</t> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<th>Department Manager</th> |
|||
<td> |
|||
<t t-if="rec['manager_id']"> |
|||
<t t-esc="rec['manager_id'][1]"/> |
|||
</t> |
|||
</td> |
|||
<th>Department Approval Date</th> |
|||
<td> |
|||
<t t-if="rec['department_approval_date']"> |
|||
<t t-esc="rec['department_approval_date']"/> |
|||
</t> |
|||
</td> |
|||
</tr> |
|||
|
|||
<tr> |
|||
<th>Approved By:</th> |
|||
<td> |
|||
<t t-if="rec['requisition_head_id']"> |
|||
<t t-esc="rec['requisition_head_id'][1]"/> |
|||
</t> |
|||
</td> |
|||
<th>Approved Date:</th> |
|||
<td> |
|||
<t t-if="rec['approval_date']"> |
|||
<t t-esc="rec['approval_date']"/> |
|||
</t> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<th>Rejected By</th> |
|||
<td> |
|||
<t t-if="rec['rejected_user_id']"> |
|||
<t t-esc="rec['rejected_user_id'][1]"/> |
|||
</t> |
|||
</td> |
|||
<th>Rejected Date</th> |
|||
<td> |
|||
<t t-if="rec['reject_date']"> |
|||
<t t-esc="rec['reject_date']"/> |
|||
</t> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
<h5>Picking Details</h5> |
|||
<table class="table table-sm"> |
|||
<tr> |
|||
<th>Source Location</th> |
|||
<td> |
|||
<t t-if="rec['source_location_id']"> |
|||
<t t-esc="rec['source_location_id'][1]"/> |
|||
</t> |
|||
</td> |
|||
<th>Destination Location</th> |
|||
<td> |
|||
<t t-if="rec['source_location_id']"> |
|||
<t t-esc="rec['destination_location_id'][1]"/> |
|||
</t> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<t t-if="rec['delivery_type_id']"> |
|||
<th>Delivery To</th> |
|||
<td> |
|||
<t t-esc="rec['delivery_type_id'][1]"/> |
|||
</td> |
|||
</t> |
|||
<t t-if="rec['internal_picking_id']"> |
|||
<th>Internal Transfer</th> |
|||
<td> |
|||
<t t-esc="rec['internal_picking_id'][1]"/> |
|||
</td> |
|||
</t> |
|||
</tr> |
|||
</table> |
|||
</t> |
|||
|
|||
<h5>Requisition Lines</h5> |
|||
<table class='table'> |
|||
<thead> |
|||
<th>Requisition Action</th> |
|||
<th>Product</th> |
|||
<th>Description</th> |
|||
<th>Quantity</th> |
|||
<th>Unit Of Measure</th> |
|||
</thead> |
|||
<t t-foreach="order_ids" t-as="order"> |
|||
<tbody> |
|||
<td> |
|||
<t t-if="order['requisition_type']=='internal_transfer'"> |
|||
Internal Transfer |
|||
</t> |
|||
<t t-if="order['requisition_type']=='purchase_order'"> |
|||
Purchase Order |
|||
</t> |
|||
</td> |
|||
<td> |
|||
<t t-if="order['product_id']"> |
|||
<t t-esc="order['product_id'][1]"/> |
|||
</t> |
|||
</td> |
|||
<td> |
|||
<t t-if="order['description']"> |
|||
<t t-esc="order['description']"/> |
|||
</t> |
|||
</td> |
|||
<td> |
|||
<t t-if="order['quantity']"> |
|||
<t t-esc="order['quantity']"/> |
|||
</t> |
|||
</td> |
|||
<td><t t-if="order['uom']"> |
|||
<t t-esc="order['uom']"/> |
|||
</t> |
|||
</td> |
|||
</tbody> |
|||
</t> |
|||
</table> |
|||
<h5>Employee Signature :</h5> |
|||
<h5>Manager Signature :</h5> |
|||
<h5>Approve Signature :</h5> |
|||
</div> |
|||
</t> |
|||
</t> |
|||
</template> |
|||
</odoo> |
|||
|
@ -0,0 +1,28 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<record model="ir.module.category" id="employee_requisition"> |
|||
<field name="name">Employee Purchase Requisition</field> |
|||
<field name="description">User access level for Material Request |
|||
module |
|||
</field> |
|||
<field name="sequence">20</field> |
|||
</record> |
|||
<!--User groups--> |
|||
<record id="employee_requisition_user" model="res.groups"> |
|||
<field name="name">Requisition Users</field> |
|||
<field name="category_id" ref="employee_requisition"/> |
|||
</record> |
|||
|
|||
<record id="employee_requisition_head" model="res.groups"> |
|||
<field name="name">Department Head</field> |
|||
<field name="category_id" ref="employee_requisition"/> |
|||
<field name="implied_ids" |
|||
eval="[(4, ref('employee_purchase_requisition.employee_requisition_user'))]"/> |
|||
</record> |
|||
<record id="employee_requisition_manager" model="res.groups"> |
|||
<field name="name">Requisition Manager</field> |
|||
<field name="category_id" ref="employee_requisition"/> |
|||
<field name="implied_ids" |
|||
eval="[(4, ref('employee_purchase_requisition.employee_requisition_head'))]"/> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,33 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!--Record rules--> |
|||
<record id="requisition_user_rule" model="ir.rule"> |
|||
<field name="name">Requisition User Rule</field> |
|||
<field name="model_id" ref="model_employee_purchase_requisition"/> |
|||
<field name="domain_force">[('confirm_id', '=', user.id)]</field> |
|||
<field name="groups" |
|||
eval="[(4, ref('employee_purchase_requisition.employee_requisition_user'))]"/> |
|||
</record> |
|||
|
|||
<record id="department_head_rule" model="ir.rule"> |
|||
<field name="name">Department Head Rule</field> |
|||
<field ref="model_employee_purchase_requisition" name="model_id"/> |
|||
<field name="domain_force">[('user_id','=',user.id)]</field> |
|||
<field name="groups" |
|||
eval="[(4, ref('employee_purchase_requisition.employee_requisition_head'))]"/> |
|||
</record> |
|||
|
|||
<record id="requisition_manager_rule" model="ir.rule"> |
|||
<field name="name">Requisition Manager Rule</field> |
|||
<field ref="model_employee_purchase_requisition" name="model_id"/> |
|||
<field name="domain_force">[(1,'=',1)]</field> |
|||
<field name="groups" |
|||
eval="[(4, ref('employee_purchase_requisition.employee_requisition_manager'))]"/> |
|||
</record> |
|||
|
|||
<record id="requisition_company_rule" model="ir.rule"> |
|||
<field name="name">Purchase Requisition Company Rule</field> |
|||
<field ref="model_employee_purchase_requisition" name="model_id"/> |
|||
<field name="domain_force">[('company_id', '=', company_id)]</field> |
|||
</record> |
|||
</odoo> |
|
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 80 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 565 B |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 38 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 73 KiB |
After Width: | Height: | Size: 49 KiB |
After Width: | Height: | Size: 90 KiB |
After Width: | Height: | Size: 86 KiB |
After Width: | Height: | Size: 82 KiB |
After Width: | Height: | Size: 125 KiB |
After Width: | Height: | Size: 140 KiB |
After Width: | Height: | Size: 147 KiB |
After Width: | Height: | Size: 150 KiB |
After Width: | Height: | Size: 149 KiB |
After Width: | Height: | Size: 153 KiB |
After Width: | Height: | Size: 144 KiB |
After Width: | Height: | Size: 74 KiB |
After Width: | Height: | Size: 53 KiB |
After Width: | Height: | Size: 159 KiB |
After Width: | Height: | Size: 103 KiB |
After Width: | Height: | Size: 108 KiB |
After Width: | Height: | Size: 111 KiB |
After Width: | Height: | Size: 162 KiB |
After Width: | Height: | Size: 103 KiB |
After Width: | Height: | Size: 55 KiB |
After Width: | Height: | Size: 132 KiB |
After Width: | Height: | Size: 134 KiB |
After Width: | Height: | Size: 145 KiB |
After Width: | Height: | Size: 696 KiB |
After Width: | Height: | Size: 90 KiB |
After Width: | Height: | Size: 10 KiB |
@ -0,0 +1,12 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<!--Action to print report--> |
|||
<record id="print_requisition_order_pdf" model="ir.actions.server"> |
|||
<field name="name">Print Requisition Order</field> |
|||
<field name="model_id" ref="employee_purchase_requisition.model_employee_purchase_requisition"/> |
|||
<field name="binding_model_id" ref="employee_purchase_requisition.model_employee_purchase_requisition"/> |
|||
<field name="binding_view_types">form</field> |
|||
<field name="state">code</field> |
|||
<field name="code">action = records.action_print_report()</field> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,11 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Employee Purchase Requisition menu --> |
|||
<menuitem id="employee_purchase_requisition_menu_root" |
|||
name="Employee Purchase Requisition" |
|||
action="employee_purchase_requisition_action"/> |
|||
<menuitem id="employee_purchase_requisition_menu_create_purchase_requisition" |
|||
name="Purchase Requisition" |
|||
parent="employee_purchase_requisition_menu_root" |
|||
action="employee_purchase_requisition_action"/> |
|||
</odoo> |
@ -0,0 +1,241 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Employee Purchase Requisition view --> |
|||
<record id="employee_purchase_requisition_action" |
|||
model="ir.actions.act_window"> |
|||
<field name="name">Purchase Requisition</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">employee.purchase.requisition</field> |
|||
<field name="view_mode">tree,form,kanban</field> |
|||
<field name="help" type="html"> |
|||
<p class="o_view_nocontent_smiling_face"> |
|||
Create a new record! |
|||
</p> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="employee_purchase_requisition_view_form" model="ir.ui.view"> |
|||
<field name="name">employee.purchase.requisition.view.form</field> |
|||
<field name="model">employee.purchase.requisition</field> |
|||
<field name="arch" type="xml"> |
|||
<form> |
|||
<header> |
|||
<field name="state" widget='statusbar' |
|||
statusbar_visible='new,waiting_department_approval,waiting_head_approval,approved,purchase_order_created,received'/> |
|||
<button name="action_confirm_requisition" |
|||
class="oe_highlight" |
|||
invisible="state != 'new'" string="Confirm" |
|||
type="object" |
|||
help="Submit to Department Approval" |
|||
groups="employee_purchase_requisition.employee_requisition_user"/> |
|||
<button name="action_department_approval" |
|||
class="oe_highlight" |
|||
invisible="state != 'waiting_department_approval'" |
|||
string="Approve" type="object" |
|||
help="Approve purchase requisition,Submit for Approval for Requisition Head" |
|||
groups="employee_purchase_requisition.employee_requisition_head"/> |
|||
<button name="action_department_cancel" |
|||
class="oe_highlight" |
|||
invisible="state != 'waiting_department_approval'" |
|||
string="Reject" type="object" |
|||
help="Reject Purchase Requisition" |
|||
groups="employee_purchase_requisition.employee_requisition_head"/> |
|||
<button name="action_head_approval" class="oe_highlight" |
|||
invisible="state != 'waiting_head_approval'" |
|||
string="Approve" |
|||
type="object" |
|||
help="Approve Purchase requisition" |
|||
groups="employee_purchase_requisition.employee_requisition_manager"/> |
|||
<button name="action_head_cancel" class="oe_highlight" |
|||
invisible="state != 'waiting_head_approval'" |
|||
string="Reject" |
|||
type="object" |
|||
help="Reject Purchase Requisition" |
|||
groups="employee_purchase_requisition.employee_requisition_manager"/> |
|||
<button name="action_create_purchase_order" |
|||
class="oe_highlight" |
|||
invisible="state != 'approved'" |
|||
string="Create Picking and PO" |
|||
type="object" |
|||
help="Create Picking/Purchase order"/> |
|||
<button name="action_receive" class="oe_highlight" |
|||
invisible="state != 'purchase_order_created'" |
|||
string="Received" |
|||
type="object" |
|||
groups="employee_purchase_requisition.employee_requisition_manager"/> |
|||
</header> |
|||
<sheet> |
|||
<div class="oe_button_box" name="button_box"> |
|||
<button class="oe_stat_button" type="object" |
|||
name="get_purchase_order" |
|||
icon="fa-book" |
|||
invisible="not purchase_count"> |
|||
<field string="Purchase Order" |
|||
name="purchase_count" widget="statinfo"/> |
|||
</button> |
|||
<button class="oe_stat_button" type="object" |
|||
name="get_internal_transfer" |
|||
icon="fa-truck" |
|||
invisible="not internal_transfer_count"> |
|||
<field string="Internal Transfer" |
|||
name="internal_transfer_count" |
|||
widget="statinfo" |
|||
/> |
|||
</button> |
|||
</div> |
|||
<div class="oe_title"> |
|||
<h1> |
|||
<field name="name" placeholder="New"/> |
|||
</h1> |
|||
</div> |
|||
<group> |
|||
<group> |
|||
<field name="employee_id" readonly="state not in ['new']"/> |
|||
<field name="dept_id"/> |
|||
<field name="user_id" readonly="state not in ['new']"/> |
|||
</group> |
|||
<group> |
|||
<field name="requisition_date" readonly="state not in ['new']"/> |
|||
<field name="receive_date"/> |
|||
<field name="requisition_deadline" readonly="state not in ['new']"/> |
|||
<field name="company_id" readonly="state not in ['new']"/> |
|||
</group> |
|||
</group> |
|||
<notebook> |
|||
<page string="Requisition Orders "> |
|||
<field name="requisition_order_ids" readonly="1 if state not in ['new','waiting_department_approval','waiting_head_approval'] else 0"/> |
|||
</page> |
|||
<page string="Picking Details" |
|||
groups="employee_purchase_requisition.employee_requisition_manager,employee_purchase_requisition.employee_requisition_head"> |
|||
<group> |
|||
<group> |
|||
<field name="source_location_id"/> |
|||
<field name="delivery_type_id"/> |
|||
</group> |
|||
<group> |
|||
<field name="destination_location_id"/> |
|||
<field name="internal_picking_id"/> |
|||
</group> |
|||
</group> |
|||
</page> |
|||
<page string="Other Info"> |
|||
<group> |
|||
<group> |
|||
<field name="confirm_id"/> |
|||
<field name="manager_id"/> |
|||
<field name="requisition_head_id"/> |
|||
<field name="rejected_user_id"/> |
|||
</group> |
|||
<group> |
|||
<field name="confirmed_date"/> |
|||
<field name="department_approval_date"/> |
|||
<field name="approval_date"/> |
|||
<field name="reject_date"/> |
|||
</group> |
|||
</group> |
|||
</page> |
|||
</notebook> |
|||
<group> |
|||
<field name="requisition_description"/> |
|||
</group> |
|||
</sheet> |
|||
<div class="oe_chatter"> |
|||
<field name="activity_ids"/> |
|||
<field name="message_ids"/> |
|||
</div> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="employee_purchase_requisition_view_tree" model="ir.ui.view"> |
|||
<field name="name">employee.purchase.requisition.view.tree</field> |
|||
<field name="model">employee.purchase.requisition</field> |
|||
<field name="arch" type="xml"> |
|||
<tree> |
|||
<field name="name"/> |
|||
<field name="employee_id"/> |
|||
<field name="dept_id"/> |
|||
<field name="user_id"/> |
|||
<field name="requisition_date"/> |
|||
<field name="state" widget="badge" |
|||
decoration-success="state in ('approved','received')" |
|||
decoration-warning="state in ('waiting_department_approval','waiting_head_approval')" |
|||
decoration-info="state =='purchase_order_created'" |
|||
decoration-danger="state =='cancelled'"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="employee_purchase_requisition_view_kanban" model="ir.ui.view"> |
|||
<field name="name">employee.purchase.requisition.view.kanban</field> |
|||
<field name="model">employee.purchase.requisition</field> |
|||
<field name="arch" type="xml"> |
|||
<kanban> |
|||
<templates> |
|||
<t t-name="kanban-box"> |
|||
<div class="oe_kanban_global_click"> |
|||
<div class="oe_kanban_content"> |
|||
<div class="oe_kanban_card"> |
|||
<div> |
|||
<b> |
|||
<field name="name"/> |
|||
</b> |
|||
</div> |
|||
<div> |
|||
<b> |
|||
<field name="employee_id"/> |
|||
</b> |
|||
</div> |
|||
<div> |
|||
<b> |
|||
<field name="dept_id"/> |
|||
</b> |
|||
</div> |
|||
<div> |
|||
<b> |
|||
<field name="user_id"/> |
|||
</b> |
|||
</div> |
|||
<div> |
|||
<b> |
|||
<field name="requisition_date"/> |
|||
</b> |
|||
</div> |
|||
<div> |
|||
<b> |
|||
<field name="state" widget="badge" |
|||
decoration-success="state in |
|||
('approved','received')" |
|||
decoration-warning="state in |
|||
('waiting_department_approval','waiting_head_approval')" |
|||
decoration-info="state |
|||
=='purchase_order_created'" |
|||
decoration-danger="state |
|||
=='cancelled'" |
|||
/> |
|||
</b> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</t> |
|||
</templates> |
|||
</kanban> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="employee_purchase_requisition_view_search" model="ir.ui.view"> |
|||
<field name="name">employee.purchase.requisition.view.search</field> |
|||
<field name="model">employee.purchase.requisition</field> |
|||
<field name="arch" type="xml"> |
|||
<search string="Search Tips"> |
|||
<group expand="1" string="Group By"> |
|||
<filter string="Employee" name="employee_id" |
|||
context="{'group_by':'employee_id', 'residual_visible':True}"/> |
|||
<filter string="Department" name="dept_id" |
|||
context="{'group_by':'dept_id', 'residual_visible':True}"/> |
|||
</group> |
|||
</search> |
|||
</field> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,15 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Adding field in the department form view --> |
|||
<record id="view_department_form" model="ir.ui.view"> |
|||
<field name="name">hr.department.view.form.inherit.employee.purchase.requisition</field> |
|||
<field name="model">hr.department</field> |
|||
<field name="inherit_id" |
|||
ref="hr.view_department_form"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//field[@name='parent_id']" position="after"> |
|||
<field name="department_location_id"/> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,21 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!--Adding field in the employee form view--> |
|||
<record id="view_employee_form" model="ir.ui.view"> |
|||
<field name="name">hr.employee.view.form.inherit.employee.purchase.requisition</field> |
|||
<field name="model">hr.employee</field> |
|||
<field name="inherit_id" |
|||
ref="hr.view_employee_form"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//page[@name='hr_settings']" position="after"> |
|||
<page name="requisition_settings" string="Purchase Requisition Settings"> |
|||
<group> |
|||
<group> |
|||
<field name="employee_location_id"/> |
|||
</group> |
|||
</group> |
|||
</page> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,15 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Adding a field in the purchase order form view --> |
|||
<record id="purchase_order_form" model="ir.ui.view"> |
|||
<field name="name">purchase.order.view.form.inherit.employee.purchase.requisition</field> |
|||
<field name="model">purchase.order</field> |
|||
<field name="inherit_id" |
|||
ref="purchase.purchase_order_form"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//field[@name='currency_id']" position="after"> |
|||
<field name="requisition_order"/> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,23 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!--Tree view for requisition order--> |
|||
<record id="requisition_order_view_tree" model="ir.ui.view"> |
|||
<field name="name">requisition.order.view.tree</field> |
|||
<field name="model">requisition.order</field> |
|||
<field name="arch" type="xml"> |
|||
<tree editable="bottom" delete="0 if state not in ['new','waiting_department_approval','waiting_head_approval'] else 1"> |
|||
<field name="state" column_invisible="True"/> |
|||
<field name="requisition_type" |
|||
invisible="state=='new'" |
|||
groups="employee_purchase_requisition.employee_requisition_head,employee_purchase_requisition.employee_requisition_manager"/> |
|||
<field name="product_id"/> |
|||
<field name="description"/> |
|||
<field name="quantity"/> |
|||
<field name="uom"/> |
|||
<field name="partner_id" |
|||
invisible="requisition_type == 'internal_transfer'" |
|||
groups="employee_purchase_requisition.employee_requisition_head,employee_purchase_requisition.employee_requisition_manager"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,16 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Adding field in the stock picking form view --> |
|||
<record id="view_picking_form" model="ir.ui.view"> |
|||
<field name="name">stock.picking.view.form.inherit.employee.purchase.requisition</field> |
|||
<field name="model">stock.picking</field> |
|||
<field name="inherit_id" |
|||
ref="stock.view_picking_form"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//field[@name='location_dest_id']" |
|||
position="after"> |
|||
<field name="requisition_order"/> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</odoo> |