diff --git a/document_approval/README.rst b/document_approval/README.rst new file mode 100755 index 000000000..ffe089965 --- /dev/null +++ b/document_approval/README.rst @@ -0,0 +1,47 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +Document Approval +================= +This module helps to approve or reject documents. + +Configuration +============= +- No additional configuration required + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +Developer: (V17) Saneen 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 `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/document_approval/__init__.py b/document_approval/__init__.py new file mode 100755 index 000000000..5cc283ff5 --- /dev/null +++ b/document_approval/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Saneen K () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import models +from . import wizards diff --git a/document_approval/__manifest__.py b/document_approval/__manifest__.py new file mode 100755 index 000000000..959cb7eb5 --- /dev/null +++ b/document_approval/__manifest__.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Saneen K () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': "Document Approval", + "version": "17.0.1.0.0", + "category": "Documents Management", + "summary": "Manager can approve or reject documents", + "description": "User can create and upload various document for approvals." + "Manager can approve or reject documents.", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['mail'], + 'data': [ + 'security/document_approval_security.xml', + 'security/ir.model.access.csv', + 'views/document_approval_team_views.xml', + 'views/document_approval_views.xml', + 'views/document_approval_menus.xml', + 'wizards/document_approve_views.xml', + 'wizards/document_reject_views.xml', + 'wizards/document_approval_signature_views.xml', + ], + 'images': ['static/description/banner.png'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': True, +} diff --git a/document_approval/doc/RELEASE_NOTES.md b/document_approval/doc/RELEASE_NOTES.md new file mode 100755 index 000000000..efce2b79f --- /dev/null +++ b/document_approval/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 16.04.2024 +#### Version 17.0.1.0.0 +#### ADD +- Initial commit for Document Approval diff --git a/document_approval/models/__init__.py b/document_approval/models/__init__.py new file mode 100755 index 000000000..f243c4fbe --- /dev/null +++ b/document_approval/models/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Saneen K () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import document_approval +from . import document_approval_file +from . import document_approval_step +from . import document_approval_team diff --git a/document_approval/models/document_approval.py b/document_approval/models/document_approval.py new file mode 100755 index 000000000..7232a778f --- /dev/null +++ b/document_approval/models/document_approval.py @@ -0,0 +1,180 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Saneen K () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import api, fields, models, _ +from odoo.exceptions import UserError + + +class DocumentApproval(models.Model): + """ A model for Managing the document approvals""" + _name = "document.approval" + _inherit = ["mail.thread", "mail.activity.mixin"] + _description = "Document Approvals" + + name = fields.Char(string='Name', required=True, + help='Name of the record.') + is_active = fields.Boolean(string='Active', copy=False, + help='Used to check the record active or not.') + description = fields.Text(string="Description", + help='Used to add description about the document' + ' approval') + approve_initiator_id = fields.Many2one('res.users', string="Initiator", + default=lambda self: self.env.user, + help='Set who has initiated the ' + 'document approval.') + team_id = fields.Many2one('document.approval.team', string="Approval Team", + required=True, + help='Set which team is approving the document.') + method = fields.Selection(selection=[('button', 'Button'), + ('sign', 'Signature')], + default='button', string="Method", + help='Set the mode of approvals.') + visibility = fields.Selection(selection=[('all_user', 'All Users'), + ('followers', 'Followers'), + ('approvers', 'Approvers')], + string='Visibility', + help='Restrict the visibility of the ' + 'document', default="all_user") + state = fields.Selection(selection=[('draft', 'Draft'), + ('waiting', 'Waiting'), + ('approved', 'Approved'), + ('reject', 'Rejected')], + string='Status', default='draft', readonly=True, + tracking=True, + help='State of the document.') + company_id = fields.Many2one('res.company', string='Company', + default=lambda self: self.env.company, + help='Company of the record.') + step_ids = fields.One2many('document.approval.step', + 'document_approve_id', + compute='_compute_step_ids', store=True, + help='For setting document approval steps') + file_ids = fields.One2many('document.approval.file', 'approval_id', + string='Files', + help='You can upload file and file details') + step_count = fields.Integer(string="Step", help="Current Step", + readonly=True) + approver_ids = fields.Many2many('res.users', string="Approver", + help="User to approve the document") + show_approve = fields.Boolean(string="Show Approve Button", copy=False, + help="To show the approve button to approve " + "the document", + compute="_compute_show_approve") + approval_ids = fields.Many2many('document.approval.step', + string="Approval Step", + help="Approval Step of the document") + + @api.depends('team_id') + def _compute_step_ids(self): + """Method _compute_step_ids to compute the values to the field + step_ids""" + for rec in self: + rec.step_ids = False + for step in rec.team_id.step_ids: + rec.step_ids = [fields.Command.create({ + 'steps': step.steps, + 'approver_id': step.approver_id.id, + 'role': step.role, + 'state': step.state, + 'note': step.note + })] + + @api.depends('team_id') + def _compute_show_approve(self): + """This method _compute_show_approve to compute the valur to the field + show_approve""" + for rec in self: + rec.show_approve = True if self.env.uid in rec.approver_ids.ids else False + if rec.team_id.team_lead_id.id == self.env.uid: + rec.show_approve = True + + def action_send_for_approval(self): + """ Action to sent document to approval also it changes the state + into waiting that document to be approved """ + steps = self.step_ids.mapped('steps') + unique_steps = [] + for step in steps: + if step not in unique_steps: + unique_steps.append(step) + unique_steps = sorted(unique_steps) + self.step_count = unique_steps[0] + aprroval_records = self.step_ids.search([('steps', '=', + unique_steps[0]), ( + 'document_approve_id', + '=', self.id)]) + self.approval_ids = aprroval_records.ids + approval_user_ids = [] + for record in aprroval_records: + approval_user_ids.append(record.approver_id.id) + record.current_state = 'pending' + self.approver_ids = approval_user_ids + self.state = "waiting" + + def action_approve(self): + """ function that return wizard to do the approval by writing note + and approver can approve the document. + Approval is done just clicking the button""" + return { + 'type': 'ir.actions.act_window', + 'name': 'Document Approval', + 'target': 'new', + 'view_mode': 'form', + 'res_model': 'document.approve', + 'context': { + 'default_document_id': self.id + } + } + + def action_reject(self): + """ Return a wizard that to confirm rejection by adding a note""" + return { + 'type': 'ir.actions.act_window', + 'name': 'Document Rejection', + 'target': 'new', + 'view_mode': 'form', + 'res_model': 'document.reject', + 'context': { + 'default_document_id': self.id + } + } + + def action_approve_sign(self): + """ Return a wizard that approver can ensure to give + signature and approve. Approver can add signature confirmation """ + return { + 'type': 'ir.actions.act_window', + 'name': 'Document Approval', + 'target': 'new', + 'view_mode': 'form', + 'res_model': 'document.approval.signature', + 'context': { + 'default_document_id': self.id + } + } + + def unlink(self): + """ This function is used to ensure to there is no record of + state approved has been deleted""" + for record in self: + if record.state in ["approved", "waiting"]: + raise UserError( + _("You cannot delete record in approved or waiting state")) + return super(DocumentApproval, self).unlink() diff --git a/document_approval/models/document_approval_file.py b/document_approval/models/document_approval_file.py new file mode 100755 index 000000000..efd79cadc --- /dev/null +++ b/document_approval/models/document_approval_file.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Saneen K () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models, _ +from odoo.exceptions import UserError + + +class DocumentApprovalFiles(models.Model): + """ Manage the documents for approvals""" + _name = 'document.approval.file' + _description = "document files" + + name = fields.Char(string="Name", required=True, + help='For adding some noted about the file ') + file = fields.Binary(string="File", required=True, attachment=True, + help='For storing the file') + file_name = fields.Char(string="File Name", + help="Storing name of the file") + approval_id = fields.Many2one('document.approval', + help='Inverse fields for the document ' + 'approval') + + def unlink(self): + """Supering the method unlink of model document.approval.line to + restrict the deleting of the file""" + for rec in self: + if rec.approval_id.state != 'Draft': + raise UserError( + _(f"You cannot delete file from {rec.approval_id.state} state")) + super(DocumentApprovalFiles, rec).unlink() diff --git a/document_approval/models/document_approval_step.py b/document_approval/models/document_approval_step.py new file mode 100755 index 000000000..1979b9ce7 --- /dev/null +++ b/document_approval/models/document_approval_step.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Saneen K () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class DocumentApprovalSteps(models.Model): + """ Document approval steps""" + _name = "document.approval.step" + _description = "Document Approvals Steps" + + steps = fields.Integer(string="Steps", + help='For counting how many steps needed') + approver_id = fields.Many2one('res.users', string="Approver", + help='The person who is responsible for ' + 'the approval') + role = fields.Char(string="Role/Position", + help='To determine the position of the approver') + document_approve_id = fields.Many2one('document.approval', + string='Document Approval', + help='Inverse field from document ' + 'approvals') + is_approve = fields.Boolean(string='Is Approved', copy=False, + help='Check weather it is approved or not') + document_approve_team_id = fields.Many2one('document.approval.team', + string="Approver Team", + help='The team who are ' + 'responsible for the ' + 'approvals') + state = fields.Selection( + selection=[('to_approve', 'To Approve'), + ('approve', 'Approve')], + default="to_approve") + note = fields.Char(string='Notes', help="To add notes") + current_state = fields.Selection( + selection=[('upcoming', 'Upcoming'), ('pending', 'Pending'), + ('approved', 'Approved')], + default="upcoming", string="Approval State", + help="THe current state of approval") diff --git a/document_approval/models/document_approval_team.py b/document_approval/models/document_approval_team.py new file mode 100755 index 000000000..c5c5b1d48 --- /dev/null +++ b/document_approval/models/document_approval_team.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Saneen K () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class DocumentApprovalTeam(models.Model): + """ Configure document approval team""" + _name = "document.approval.team" + _inherit = ["mail.thread", "mail.activity.mixin"] + _description = "Document approval team" + + name = fields.Char(string='Name', required=True, help='Name of the team', + tracking=True) + team_lead_id = fields.Many2one('res.users', string='Team Leader', + help='For setting th team lead', + tracking=True, required=True, + default=lambda self: self.env.user) + company_id = fields.Many2one('res.company', string='Company', + help='For setting the company', + default=lambda self: self.env.company) + is_active = fields.Boolean(string="Active", copy=False, + help='For checking the active status') + step_ids = fields.One2many('document.approval.step', + 'document_approve_team_id', + help='For setting document approval steps for ' + 'the approval team') diff --git a/document_approval/security/document_approval_security.xml b/document_approval/security/document_approval_security.xml new file mode 100755 index 000000000..0ea5b47c7 --- /dev/null +++ b/document_approval/security/document_approval_security.xml @@ -0,0 +1,26 @@ + + + + + document approval rule user + + + ['|',('step_ids.approver_id.id','=',user.id),('approve_initiator_id','=',user.id)] + + + + + + + + + + Document Approval Multi Company + + + ['|', ('company_id', '=', False), + ('company_id', 'in', company_ids)] + + + diff --git a/document_approval/security/ir.model.access.csv b/document_approval/security/ir.model.access.csv new file mode 100755 index 000000000..05451c48a --- /dev/null +++ b/document_approval/security/ir.model.access.csv @@ -0,0 +1,8 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +document_approval.access_document_approval,access_document_approval,document_approval.model_document_approval,base.group_user,1,1,1,1 +access_document_approval_team_user,access.document.approval.team.user,model_document_approval_team,base.group_user,1,1,1,1 +access_document_approval_steps_user,access.document.approval.steps.user,model_document_approval_step,base.group_user,1,1,1,1 +access_document_approval_file_user,access.document.approval.file.user,model_document_approval_file,base.group_user,1,1,1,1 +access_document_approval_user,access.document.approval.user,model_document_approve,base.group_user,1,1,1,1 +access_document_reject_user,access.document.reject.user,model_document_reject,base.group_user,1,1,1,1 +access_document_approval_signature_user,access.document.approval.signature.user,model_document_approval_signature,base.group_user,1,1,1,1 diff --git a/document_approval/static/description/assets/icons/check.png b/document_approval/static/description/assets/icons/check.png new file mode 100755 index 000000000..c8e85f51d Binary files /dev/null and b/document_approval/static/description/assets/icons/check.png differ diff --git a/document_approval/static/description/assets/icons/chevron.png b/document_approval/static/description/assets/icons/chevron.png new file mode 100755 index 000000000..2089293d6 Binary files /dev/null and b/document_approval/static/description/assets/icons/chevron.png differ diff --git a/document_approval/static/description/assets/icons/cogs.png b/document_approval/static/description/assets/icons/cogs.png new file mode 100755 index 000000000..95d0bad62 Binary files /dev/null and b/document_approval/static/description/assets/icons/cogs.png differ diff --git a/document_approval/static/description/assets/icons/consultation.png b/document_approval/static/description/assets/icons/consultation.png new file mode 100755 index 000000000..8319d4baa Binary files /dev/null and b/document_approval/static/description/assets/icons/consultation.png differ diff --git a/document_approval/static/description/assets/icons/ecom-black.png b/document_approval/static/description/assets/icons/ecom-black.png new file mode 100755 index 000000000..a9385ff13 Binary files /dev/null and b/document_approval/static/description/assets/icons/ecom-black.png differ diff --git a/document_approval/static/description/assets/icons/education-black.png b/document_approval/static/description/assets/icons/education-black.png new file mode 100755 index 000000000..3eb09b27b Binary files /dev/null and b/document_approval/static/description/assets/icons/education-black.png differ diff --git a/document_approval/static/description/assets/icons/hotel-black.png b/document_approval/static/description/assets/icons/hotel-black.png new file mode 100755 index 000000000..130f613be Binary files /dev/null and b/document_approval/static/description/assets/icons/hotel-black.png differ diff --git a/document_approval/static/description/assets/icons/license.png b/document_approval/static/description/assets/icons/license.png new file mode 100755 index 000000000..a5869797e Binary files /dev/null and b/document_approval/static/description/assets/icons/license.png differ diff --git a/document_approval/static/description/assets/icons/lifebuoy.png b/document_approval/static/description/assets/icons/lifebuoy.png new file mode 100755 index 000000000..658d56ccc Binary files /dev/null and b/document_approval/static/description/assets/icons/lifebuoy.png differ diff --git a/document_approval/static/description/assets/icons/manufacturing-black.png b/document_approval/static/description/assets/icons/manufacturing-black.png new file mode 100755 index 000000000..697eb0e9f Binary files /dev/null and b/document_approval/static/description/assets/icons/manufacturing-black.png differ diff --git a/document_approval/static/description/assets/icons/pos-black.png b/document_approval/static/description/assets/icons/pos-black.png new file mode 100755 index 000000000..97c0f90c1 Binary files /dev/null and b/document_approval/static/description/assets/icons/pos-black.png differ diff --git a/document_approval/static/description/assets/icons/puzzle.png b/document_approval/static/description/assets/icons/puzzle.png new file mode 100755 index 000000000..65cf854e7 Binary files /dev/null and b/document_approval/static/description/assets/icons/puzzle.png differ diff --git a/document_approval/static/description/assets/icons/restaurant-black.png b/document_approval/static/description/assets/icons/restaurant-black.png new file mode 100755 index 000000000..4a35eb939 Binary files /dev/null and b/document_approval/static/description/assets/icons/restaurant-black.png differ diff --git a/document_approval/static/description/assets/icons/service-black.png b/document_approval/static/description/assets/icons/service-black.png new file mode 100755 index 000000000..301ab51cb Binary files /dev/null and b/document_approval/static/description/assets/icons/service-black.png differ diff --git a/document_approval/static/description/assets/icons/trading-black.png b/document_approval/static/description/assets/icons/trading-black.png new file mode 100755 index 000000000..9398ba2f1 Binary files /dev/null and b/document_approval/static/description/assets/icons/trading-black.png differ diff --git a/document_approval/static/description/assets/icons/training.png b/document_approval/static/description/assets/icons/training.png new file mode 100755 index 000000000..884ca024d Binary files /dev/null and b/document_approval/static/description/assets/icons/training.png differ diff --git a/document_approval/static/description/assets/icons/update.png b/document_approval/static/description/assets/icons/update.png new file mode 100755 index 000000000..ecbc5a01a Binary files /dev/null and b/document_approval/static/description/assets/icons/update.png differ diff --git a/document_approval/static/description/assets/icons/user.png b/document_approval/static/description/assets/icons/user.png new file mode 100755 index 000000000..6ffb23d9f Binary files /dev/null and b/document_approval/static/description/assets/icons/user.png differ diff --git a/document_approval/static/description/assets/icons/wrench.png b/document_approval/static/description/assets/icons/wrench.png new file mode 100755 index 000000000..6c04dea0f Binary files /dev/null and b/document_approval/static/description/assets/icons/wrench.png differ diff --git a/document_approval/static/description/assets/misc/categories.png b/document_approval/static/description/assets/misc/categories.png new file mode 100755 index 000000000..bedf1e0b1 Binary files /dev/null and b/document_approval/static/description/assets/misc/categories.png differ diff --git a/document_approval/static/description/assets/misc/check-box.png b/document_approval/static/description/assets/misc/check-box.png new file mode 100755 index 000000000..42caf24b9 Binary files /dev/null and b/document_approval/static/description/assets/misc/check-box.png differ diff --git a/document_approval/static/description/assets/misc/compass.png b/document_approval/static/description/assets/misc/compass.png new file mode 100755 index 000000000..d5fed8faa Binary files /dev/null and b/document_approval/static/description/assets/misc/compass.png differ diff --git a/document_approval/static/description/assets/misc/corporate.png b/document_approval/static/description/assets/misc/corporate.png new file mode 100755 index 000000000..2eb13edbf Binary files /dev/null and b/document_approval/static/description/assets/misc/corporate.png differ diff --git a/document_approval/static/description/assets/misc/customer-support.png b/document_approval/static/description/assets/misc/customer-support.png new file mode 100755 index 000000000..79efc72ed Binary files /dev/null and b/document_approval/static/description/assets/misc/customer-support.png differ diff --git a/document_approval/static/description/assets/misc/cybrosys-logo.png b/document_approval/static/description/assets/misc/cybrosys-logo.png new file mode 100755 index 000000000..cc3cc0ccf Binary files /dev/null and b/document_approval/static/description/assets/misc/cybrosys-logo.png differ diff --git a/document_approval/static/description/assets/misc/features.png b/document_approval/static/description/assets/misc/features.png new file mode 100755 index 000000000..b41769f77 Binary files /dev/null and b/document_approval/static/description/assets/misc/features.png differ diff --git a/document_approval/static/description/assets/misc/logo.png b/document_approval/static/description/assets/misc/logo.png new file mode 100755 index 000000000..478462d3e Binary files /dev/null and b/document_approval/static/description/assets/misc/logo.png differ diff --git a/document_approval/static/description/assets/misc/pictures.png b/document_approval/static/description/assets/misc/pictures.png new file mode 100755 index 000000000..56d255fe9 Binary files /dev/null and b/document_approval/static/description/assets/misc/pictures.png differ diff --git a/document_approval/static/description/assets/misc/pie-chart.png b/document_approval/static/description/assets/misc/pie-chart.png new file mode 100755 index 000000000..426e05244 Binary files /dev/null and b/document_approval/static/description/assets/misc/pie-chart.png differ diff --git a/document_approval/static/description/assets/misc/right-arrow.png b/document_approval/static/description/assets/misc/right-arrow.png new file mode 100755 index 000000000..730984a06 Binary files /dev/null and b/document_approval/static/description/assets/misc/right-arrow.png differ diff --git a/document_approval/static/description/assets/misc/star.png b/document_approval/static/description/assets/misc/star.png new file mode 100755 index 000000000..2eb9ab29f Binary files /dev/null and b/document_approval/static/description/assets/misc/star.png differ diff --git a/document_approval/static/description/assets/misc/support.png b/document_approval/static/description/assets/misc/support.png new file mode 100755 index 000000000..4f18b8b82 Binary files /dev/null and b/document_approval/static/description/assets/misc/support.png differ diff --git a/document_approval/static/description/assets/misc/whatsapp.png b/document_approval/static/description/assets/misc/whatsapp.png new file mode 100755 index 000000000..d513a5356 Binary files /dev/null and b/document_approval/static/description/assets/misc/whatsapp.png differ diff --git a/document_approval/static/description/assets/modules/1.jpg b/document_approval/static/description/assets/modules/1.jpg new file mode 100644 index 000000000..4ddb531ee Binary files /dev/null and b/document_approval/static/description/assets/modules/1.jpg differ diff --git a/document_approval/static/description/assets/modules/2.jpg b/document_approval/static/description/assets/modules/2.jpg new file mode 100644 index 000000000..614f52534 Binary files /dev/null and b/document_approval/static/description/assets/modules/2.jpg differ diff --git a/document_approval/static/description/assets/modules/3.jpg b/document_approval/static/description/assets/modules/3.jpg new file mode 100644 index 000000000..fcec98d16 Binary files /dev/null and b/document_approval/static/description/assets/modules/3.jpg differ diff --git a/document_approval/static/description/assets/modules/4.jpg b/document_approval/static/description/assets/modules/4.jpg new file mode 100644 index 000000000..366c7fc26 Binary files /dev/null and b/document_approval/static/description/assets/modules/4.jpg differ diff --git a/document_approval/static/description/assets/modules/7.png b/document_approval/static/description/assets/modules/7.png new file mode 100644 index 000000000..469963f22 Binary files /dev/null and b/document_approval/static/description/assets/modules/7.png differ diff --git a/document_approval/static/description/assets/modules/8.png b/document_approval/static/description/assets/modules/8.png new file mode 100644 index 000000000..2cd293552 Binary files /dev/null and b/document_approval/static/description/assets/modules/8.png differ diff --git a/document_approval/static/description/assets/screenshots/1.png b/document_approval/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..8b14a763e Binary files /dev/null and b/document_approval/static/description/assets/screenshots/1.png differ diff --git a/document_approval/static/description/assets/screenshots/10.png b/document_approval/static/description/assets/screenshots/10.png new file mode 100644 index 000000000..d6cbc3b3a Binary files /dev/null and b/document_approval/static/description/assets/screenshots/10.png differ diff --git a/document_approval/static/description/assets/screenshots/11.png b/document_approval/static/description/assets/screenshots/11.png new file mode 100644 index 000000000..5ec09e101 Binary files /dev/null and b/document_approval/static/description/assets/screenshots/11.png differ diff --git a/document_approval/static/description/assets/screenshots/12.png b/document_approval/static/description/assets/screenshots/12.png new file mode 100644 index 000000000..1f416dd15 Binary files /dev/null and b/document_approval/static/description/assets/screenshots/12.png differ diff --git a/document_approval/static/description/assets/screenshots/13.png b/document_approval/static/description/assets/screenshots/13.png new file mode 100644 index 000000000..7a1edb474 Binary files /dev/null and b/document_approval/static/description/assets/screenshots/13.png differ diff --git a/document_approval/static/description/assets/screenshots/14.png b/document_approval/static/description/assets/screenshots/14.png new file mode 100644 index 000000000..09f23490c Binary files /dev/null and b/document_approval/static/description/assets/screenshots/14.png differ diff --git a/document_approval/static/description/assets/screenshots/15.png b/document_approval/static/description/assets/screenshots/15.png new file mode 100644 index 000000000..d98fedd83 Binary files /dev/null and b/document_approval/static/description/assets/screenshots/15.png differ diff --git a/document_approval/static/description/assets/screenshots/2.png b/document_approval/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..6a575cf79 Binary files /dev/null and b/document_approval/static/description/assets/screenshots/2.png differ diff --git a/document_approval/static/description/assets/screenshots/3.png b/document_approval/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..1ca65d7ba Binary files /dev/null and b/document_approval/static/description/assets/screenshots/3.png differ diff --git a/document_approval/static/description/assets/screenshots/4.png b/document_approval/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..cf867fa7a Binary files /dev/null and b/document_approval/static/description/assets/screenshots/4.png differ diff --git a/document_approval/static/description/assets/screenshots/5.png b/document_approval/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..c37f29378 Binary files /dev/null and b/document_approval/static/description/assets/screenshots/5.png differ diff --git a/document_approval/static/description/assets/screenshots/6.png b/document_approval/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..2ba2b0a65 Binary files /dev/null and b/document_approval/static/description/assets/screenshots/6.png differ diff --git a/document_approval/static/description/assets/screenshots/7.png b/document_approval/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..c4200b55c Binary files /dev/null and b/document_approval/static/description/assets/screenshots/7.png differ diff --git a/document_approval/static/description/assets/screenshots/8.png b/document_approval/static/description/assets/screenshots/8.png new file mode 100644 index 000000000..660822d48 Binary files /dev/null and b/document_approval/static/description/assets/screenshots/8.png differ diff --git a/document_approval/static/description/assets/screenshots/9.png b/document_approval/static/description/assets/screenshots/9.png new file mode 100644 index 000000000..60a2c1a32 Binary files /dev/null and b/document_approval/static/description/assets/screenshots/9.png differ diff --git a/document_approval/static/description/assets/screenshots/hero.gif b/document_approval/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..7f4ba01c3 Binary files /dev/null and b/document_approval/static/description/assets/screenshots/hero.gif differ diff --git a/document_approval/static/description/banner.png b/document_approval/static/description/banner.png new file mode 100644 index 000000000..9c223d5e6 Binary files /dev/null and b/document_approval/static/description/banner.png differ diff --git a/document_approval/static/description/icon.png b/document_approval/static/description/icon.png new file mode 100644 index 000000000..3998ee7d7 Binary files /dev/null and b/document_approval/static/description/icon.png differ diff --git a/document_approval/static/description/index.html b/document_approval/static/description/index.html new file mode 100644 index 000000000..cc7c22480 --- /dev/null +++ b/document_approval/static/description/index.html @@ -0,0 +1,908 @@ + + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+
+
+
+
+

+ Document Approval

+

Approve or Reject Various Documents. +

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

Approve or Reject Various Documents.

+
+
+
+
+
+
+ +
+
+

+ Set Different Team for Approvals.

+
+
+
+
+
+
+ +
+
+

+ Set Various Steps for Approving.

+
+
+
+
+
+
+ +
+
+

+ Signature Approval.

+
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+

+ Document Approval Menu.

+
+
+
+
+
+
+ +
+
+

+ Approval Team Menu

+
+
+
+
+
+
+ +
+
+

+ Set the Approval team.

+
+
+
+
+
+
+ +
+
+

+ Approval Form View. Click on the 'Send for Approval' Button for Approval Request.

+
+
+
+
+
+
+ +
+
+

+ Button Approval.

+

+ After sending the approval request using the 'Button' method, clicking on the 'Approve' + button triggers a wizard to add a description for the approval. Upon adding the description, + clicking the 'Approve' button finalizes the approval process. +

+
+
+
+
+
+
+ +
+
+

+ Approval Request Status.

+
+
+
+
+
+
+ +
+
+

+ Signature Approval.

+
+
+
+
+
+
+ +
+
+

+ After sending the approval request using the 'Signature' method, clicking on the 'Approve' + button prompts a wizard to input a description and add a signature for the approval. Once + the description and signature are provided, clicking the 'Approve' button completes the approval process. +

+
+
+
+
+
+
+ +
+
+

+ After confirming the approval the state is changed to the 'Approved'.

+
+
+
+
+
+
+ +
+
+

+ Reject the Approval Request.

+
+
+
+
+
+
+ +
+
+

+ We can add the Description/Reason for the Approval Rejection.

+
+
+
+
+
+
+ +
+
+

+ Rejected Approval Request.

+
+
+
+
+
+
+ +
+
+

+ Document Signature Approval Description.

+
+
+
+
+
+
+ +
+
+

+ Document Approval Description.

+
+
+
+
+
+
+ +
+
+

+ Document Reject Description.

+
+
+
+
+
+
+
    +
  • + Approve or Reject Various Documents. +
  • +
  • + Set Different Team for Approvals. +
  • +
  • + Set Various Steps for Approving. +
  • +
  • + + Signature Approval. +
  • +
  • + + The module support Community and Enterprise +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:01st Apr 2024 +
+

+ Initial commit for Document Approval

+
+
+
+
+
+
+
+

+ Related Products

+
+
+ +
+
+

+ Our Services

+ +
+
+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Customization

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Support

+
+
+
+
+
+
+ service-icon +
+
+

Hire + Odoo Developer

+
+
+
+
+ +
+
+ service-icon +
+
+

Odoo + Integration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Migration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Consultancy

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Licensing Consultancy

+
+
+
+
+
+
+

+ Our Industries

+ +
+
+
+
+
+
+ +

Trading

+

Easily procure and sell your products

+
+
+
+
+ +

POS

+

Easy configuration and convivial experience

+
+
+
+
+ +

+ Education

+

A platform for educational management

+
+
+
+
+ +

+ Manufacturing

+

Plan, track and schedule your operations

+
+
+
+
+ +

E-commerce + & Website

+

Mobile friendly, awe-inspiring product pages

+
+
+
+
+ +

Service + Management

+

Keep track of services and invoice

+
+
+
+
+ +

+ Restaurant

+

Run your bar or restaurant methodically

+
+
+
+
+ +

Hotel + Management

+

An all-inclusive hotel management application

+
+
+
+
+
+
+

+ Support

+
+
+
+
+
+
+
+ +
+ Need + Help? +

Got + questions or need help? Get in touch.

+
odoo@cybrosys.com +
+
+
+
+
+
+
+
+ +
+ WhatsApp +

Say hi to + us on WhatsApp!

+
+91 + 99456767686 +
+
+
+
+
+
+
+
+
+ + + + + + diff --git a/document_approval/views/document_approval_menus.xml b/document_approval/views/document_approval_menus.xml new file mode 100755 index 000000000..d9711f51d --- /dev/null +++ b/document_approval/views/document_approval_menus.xml @@ -0,0 +1,22 @@ + + + + + + + + + + diff --git a/document_approval/views/document_approval_team_views.xml b/document_approval/views/document_approval_team_views.xml new file mode 100755 index 000000000..45ee477f3 --- /dev/null +++ b/document_approval/views/document_approval_team_views.xml @@ -0,0 +1,64 @@ + + + + + document.approval.team.view.tree + document.approval.team + + + + + + + + + + + document.approval.team.view.form + document.approval.team + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+
+
+ + + Document Approval Team + document.approval.team + tree,form + +

+ Create a Document Approval Team +

+
+
+
diff --git a/document_approval/views/document_approval_views.xml b/document_approval/views/document_approval_views.xml new file mode 100755 index 000000000..033781d6f --- /dev/null +++ b/document_approval/views/document_approval_views.xml @@ -0,0 +1,155 @@ + + + + + document.approval.view.tree + document.approval + + + + + + + + + + + + document.approval.view.form + document.approval + +
+
+
+ +

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+
+
+
+ + + Document Approval + document.approval + tree,form + +

+ Create Document Approval +

+
+
+ + + document.approval.step.view.tree + document.approval.step + + + + + + + + + + + + document.approval.file.view.form + document.approval.file + +
+ + + + + + + + +
+
+
+
diff --git a/document_approval/wizards/__init__.py b/document_approval/wizards/__init__.py new file mode 100755 index 000000000..2f7f01b37 --- /dev/null +++ b/document_approval/wizards/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Saneen K () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import document_approve +from . import document_approval_signature +from . import document_reject diff --git a/document_approval/wizards/document_approval_signature.py b/document_approval/wizards/document_approval_signature.py new file mode 100755 index 000000000..aa596577a --- /dev/null +++ b/document_approval/wizards/document_approval_signature.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Saneen K () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class DocumentApprovalSignature(models.TransientModel): + """ Document approval using signature confirmation""" + _name = "document.approval.signature" + _description = "Document signature approvals" + _rec_name = "document_id" + + note = fields.Text(string='Note', required=True, help='For adding notes') + signature = fields.Binary(string='Signature', required=True, + help='For writing signature') + document_id = fields.Many2one("document.approval", string="Document", + help="To track which document is get " + "approved ") + + def action_approve_signature(self): + """ Function to approve document using signature""" + if self.document_id.team_id.team_lead_id.id == self.env.uid: + self.document_id.state = "approved" + else: + if self.env.uid in self.document_id.approver_ids.ids: + self.document_id.approval_ids.write({ + 'current_state': 'approved', + }) + if 'approve' in self.document_id.approval_ids.mapped('state'): + self.document_id.state = 'approved' + return True + steps = self.document_id.step_ids.mapped('steps') + unique_steps = [] + for step in steps: + if step not in unique_steps: + unique_steps.append(step) + unique_steps = sorted(unique_steps) + index_unique = unique_steps.index(self.document_id.step_count) + if index_unique < len(unique_steps) - 1: + next_number = unique_steps[index_unique + 1] + self.document_id.step_count = next_number + approval_records = self.document_id.step_ids.search( + [('steps', '=', + next_number), ( + 'document_approve_id', + '=', + self.document_id.id)]) + self.document_id.approval_ids = approval_records.ids + self.document_id.approval_ids.write({ + 'current_state': 'pending', + }) + users = [] + for step in approval_records: + users.append(step.approver_id.id) + self.document_id.approver_ids = users + else: + self.document_id.approval_ids.write({ + 'current_state': 'approved', + }) + self.document_id.state = 'approved' diff --git a/document_approval/wizards/document_approval_signature_views.xml b/document_approval/wizards/document_approval_signature_views.xml new file mode 100755 index 000000000..53780b337 --- /dev/null +++ b/document_approval/wizards/document_approval_signature_views.xml @@ -0,0 +1,70 @@ + + + + + document.approval.signature.view.form + document.approval.signature + +
+ + + + + +
+
+
+
+
+
+ + + document.approval.signature.view.form + document.approval.signature + +
+ + + + + + + + + +
+
+
+ + + document.approval.signature.view.tree + document.approval.signature + + + + + + + + + + Document Signature Approval + document.approval.signature + tree,form + + + +
diff --git a/document_approval/wizards/document_approve.py b/document_approval/wizards/document_approve.py new file mode 100755 index 000000000..773354efe --- /dev/null +++ b/document_approval/wizards/document_approve.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Saneen K () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class DocumentApprove(models.TransientModel): + """ Wizard for approving documents""" + _name = "document.approve" + _description = "Wizard for approving document" + _rec_name = "document_id" + + description = fields.Text(string="Description", required=True, + help='Add note which is the reason for the ' + 'approval') + document_id = fields.Many2one("document.approval", string="Document", + help="To track which document is get approved") + + def action_approve_document(self): + """ function to approve document""" + if self.document_id.team_id.team_lead_id.id == self.env.uid: + self.document_id.state = "approved" + else: + if self.env.uid in self.document_id.approver_ids.ids: + self.document_id.approval_ids.write({ + 'current_state': 'approved', + }) + if 'approve' in self.document_id.approval_ids.mapped('state'): + self.document_id.state = 'approved' + return True + steps = self.document_id.step_ids.mapped('steps') + unique_steps = [] + for step in steps: + if step not in unique_steps: + unique_steps.append(step) + unique_steps = sorted(unique_steps) + index_unique = unique_steps.index(self.document_id.step_count) + if index_unique < len(unique_steps) - 1: + next_number = unique_steps[index_unique + 1] + self.document_id.step_count = next_number + approval_records = self.document_id.step_ids.search( + [('steps', '=', + next_number), ( + 'document_approve_id', + '=', + self.document_id.id)]) + self.document_id.approval_ids = approval_records.ids + self.document_id.approval_ids.write({ + 'current_state': 'pending', + }) + users = [] + for step in approval_records: + users.append(step.approver_id.id) + self.document_id.approver_ids = users + else: + self.document_id.state = 'approved' diff --git a/document_approval/wizards/document_approve_views.xml b/document_approval/wizards/document_approve_views.xml new file mode 100755 index 000000000..be5f0c033 --- /dev/null +++ b/document_approval/wizards/document_approve_views.xml @@ -0,0 +1,63 @@ + + + + + document.approve.view.form + document.approve + +
+ + + +
+
+
+
+
+ + + document.approve.view.form + document.approve + +
+ + + + + + + + +
+
+
+ + + document.approve.view.tree + document.approve + + + + + + + + + + Document Approve + document.approve + tree,form + + + +
diff --git a/document_approval/wizards/document_reject.py b/document_approval/wizards/document_reject.py new file mode 100755 index 000000000..dde515ac3 --- /dev/null +++ b/document_approval/wizards/document_reject.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Saneen K () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class DocumentReject(models.TransientModel): + """ Wizard for rejecting documents""" + _name = "document.reject" + _description = "Wizard for document reject" + _rec_name = "document_id" + + description = fields.Text(string="Description", + help='For adding reason for the rejection') + document_id = fields.Many2one("document.approval", string="Document", + help="To track which document is get approved") + + def action_reject_document(self): + """ Function to reject document""" + self.document_id.state = "reject" diff --git a/document_approval/wizards/document_reject_views.xml b/document_approval/wizards/document_reject_views.xml new file mode 100755 index 000000000..ac7a41efc --- /dev/null +++ b/document_approval/wizards/document_reject_views.xml @@ -0,0 +1,46 @@ + + + + + document.reject.view.form + document.reject + +
+ + + + +
+
+
+
+
+ + + document.reject.view.tree + document.reject + + + + + + + + + + Document Reject + document.reject + tree + + + +