diff --git a/document_approval/README.rst b/document_approval/README.rst new file mode 100755 index 000000000..a6a27c1b5 --- /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: (V16) Sreeshanth V S, 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..4c86ca5a7 --- /dev/null +++ b/document_approval/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Sreeshanth V S() +# +# 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..bc82a566c --- /dev/null +++ b/document_approval/__manifest__.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Sreeshanth V S () +# +# 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": "16.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', + 'wizards/document_approve_views.xml', + 'wizards/document_reject_views.xml', + 'wizards/document_approval_signature_views.xml', + 'views/document_approval_menus.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..1492f91e2 --- /dev/null +++ b/document_approval/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 14.02.2024 +#### Version 16.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..22fb4380e --- /dev/null +++ b/document_approval/models/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Sreeshanth V S() +# +# 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..b32273b6e --- /dev/null +++ b/document_approval/models/document_approval.py @@ -0,0 +1,179 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Sreeshanth V S() +# +# 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): + """ Manage 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', + 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", + 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..e691dae73 --- /dev/null +++ b/document_approval/models/document_approval_file.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Sreeshanth V S() +# +# 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, + 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..7503d694e --- /dev/null +++ b/document_approval/models/document_approval_step.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author:Sreeshanth V S() +# +# 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(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..279a42349 --- /dev/null +++ b/document_approval/models/document_approval_team.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Sreeshanth V S() +# +# 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", + 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.png b/document_approval/static/description/assets/modules/1.png new file mode 100755 index 000000000..489f44e86 Binary files /dev/null and b/document_approval/static/description/assets/modules/1.png differ diff --git a/document_approval/static/description/assets/modules/2.png b/document_approval/static/description/assets/modules/2.png new file mode 100755 index 000000000..4f9e87f6e Binary files /dev/null and b/document_approval/static/description/assets/modules/2.png differ diff --git a/document_approval/static/description/assets/modules/3.png b/document_approval/static/description/assets/modules/3.png new file mode 100755 index 000000000..e571015b1 Binary files /dev/null and b/document_approval/static/description/assets/modules/3.png differ diff --git a/document_approval/static/description/assets/modules/4.png b/document_approval/static/description/assets/modules/4.png new file mode 100755 index 000000000..624ef69b7 Binary files /dev/null and b/document_approval/static/description/assets/modules/4.png differ diff --git a/document_approval/static/description/assets/modules/5.gif b/document_approval/static/description/assets/modules/5.gif new file mode 100755 index 000000000..8f40aab85 Binary files /dev/null and b/document_approval/static/description/assets/modules/5.gif differ diff --git a/document_approval/static/description/assets/modules/6.png b/document_approval/static/description/assets/modules/6.png new file mode 100755 index 000000000..31ed46762 Binary files /dev/null and b/document_approval/static/description/assets/modules/6.png differ diff --git a/document_approval/static/description/assets/screenshots/document_approvals_01.png b/document_approval/static/description/assets/screenshots/document_approvals_01.png new file mode 100644 index 000000000..2eeb7c1c0 Binary files /dev/null and b/document_approval/static/description/assets/screenshots/document_approvals_01.png differ diff --git a/document_approval/static/description/assets/screenshots/document_approvals_03.png b/document_approval/static/description/assets/screenshots/document_approvals_03.png new file mode 100755 index 000000000..2f00b198d Binary files /dev/null and b/document_approval/static/description/assets/screenshots/document_approvals_03.png differ diff --git a/document_approval/static/description/assets/screenshots/document_approvals_04.png b/document_approval/static/description/assets/screenshots/document_approvals_04.png new file mode 100755 index 000000000..553f2de40 Binary files /dev/null and b/document_approval/static/description/assets/screenshots/document_approvals_04.png differ diff --git a/document_approval/static/description/assets/screenshots/document_approvals_05.png b/document_approval/static/description/assets/screenshots/document_approvals_05.png new file mode 100644 index 000000000..a90d08774 Binary files /dev/null and b/document_approval/static/description/assets/screenshots/document_approvals_05.png differ diff --git a/document_approval/static/description/assets/screenshots/document_approvals_06.png b/document_approval/static/description/assets/screenshots/document_approvals_06.png new file mode 100644 index 000000000..e54114a0d Binary files /dev/null and b/document_approval/static/description/assets/screenshots/document_approvals_06.png differ diff --git a/document_approval/static/description/assets/screenshots/document_approvals_07.png b/document_approval/static/description/assets/screenshots/document_approvals_07.png new file mode 100755 index 000000000..925424862 Binary files /dev/null and b/document_approval/static/description/assets/screenshots/document_approvals_07.png differ diff --git a/document_approval/static/description/assets/screenshots/document_approvals_08.png b/document_approval/static/description/assets/screenshots/document_approvals_08.png new file mode 100755 index 000000000..dbbe0c1c9 Binary files /dev/null and b/document_approval/static/description/assets/screenshots/document_approvals_08.png differ diff --git a/document_approval/static/description/assets/screenshots/document_approvals_09.png b/document_approval/static/description/assets/screenshots/document_approvals_09.png new file mode 100755 index 000000000..04b934a2d Binary files /dev/null and b/document_approval/static/description/assets/screenshots/document_approvals_09.png differ diff --git a/document_approval/static/description/assets/screenshots/document_approvals_10.png b/document_approval/static/description/assets/screenshots/document_approvals_10.png new file mode 100644 index 000000000..e52ac93b8 Binary files /dev/null and b/document_approval/static/description/assets/screenshots/document_approvals_10.png differ diff --git a/document_approval/static/description/assets/screenshots/document_approvals_11.png b/document_approval/static/description/assets/screenshots/document_approvals_11.png new file mode 100644 index 000000000..1892c50a3 Binary files /dev/null and b/document_approval/static/description/assets/screenshots/document_approvals_11.png differ diff --git a/document_approval/static/description/assets/screenshots/document_approvals_12.png b/document_approval/static/description/assets/screenshots/document_approvals_12.png new file mode 100644 index 000000000..52435f4e7 Binary files /dev/null and b/document_approval/static/description/assets/screenshots/document_approvals_12.png differ diff --git a/document_approval/static/description/assets/screenshots/document_approvals_13.png b/document_approval/static/description/assets/screenshots/document_approvals_13.png new file mode 100644 index 000000000..b57da9238 Binary files /dev/null and b/document_approval/static/description/assets/screenshots/document_approvals_13.png differ diff --git a/document_approval/static/description/assets/screenshots/document_approvals_14.png b/document_approval/static/description/assets/screenshots/document_approvals_14.png new file mode 100755 index 000000000..611be8138 Binary files /dev/null and b/document_approval/static/description/assets/screenshots/document_approvals_14.png differ diff --git a/document_approval/static/description/assets/screenshots/document_approvals_15.png b/document_approval/static/description/assets/screenshots/document_approvals_15.png new file mode 100644 index 000000000..e2a2c84b9 Binary files /dev/null and b/document_approval/static/description/assets/screenshots/document_approvals_15.png differ diff --git a/document_approval/static/description/assets/screenshots/document_approvals_16.png b/document_approval/static/description/assets/screenshots/document_approvals_16.png new file mode 100755 index 000000000..76ba47412 Binary files /dev/null and b/document_approval/static/description/assets/screenshots/document_approvals_16.png differ diff --git a/document_approval/static/description/assets/screenshots/document_approvals_17.png b/document_approval/static/description/assets/screenshots/document_approvals_17.png new file mode 100644 index 000000000..610d63d6e Binary files /dev/null and b/document_approval/static/description/assets/screenshots/document_approvals_17.png differ diff --git a/document_approval/static/description/assets/screenshots/document_approvals_18.png b/document_approval/static/description/assets/screenshots/document_approvals_18.png new file mode 100644 index 000000000..8523daf58 Binary files /dev/null and b/document_approval/static/description/assets/screenshots/document_approvals_18.png differ diff --git a/document_approval/static/description/assets/screenshots/document_approvals_19.png b/document_approval/static/description/assets/screenshots/document_approvals_19.png new file mode 100644 index 000000000..604272118 Binary files /dev/null and b/document_approval/static/description/assets/screenshots/document_approvals_19.png differ diff --git a/document_approval/static/description/assets/screenshots/document_approvals_20.png b/document_approval/static/description/assets/screenshots/document_approvals_20.png new file mode 100644 index 000000000..569d6fd57 Binary files /dev/null and b/document_approval/static/description/assets/screenshots/document_approvals_20.png differ diff --git a/document_approval/static/description/assets/screenshots/document_approvals_21.png b/document_approval/static/description/assets/screenshots/document_approvals_21.png new file mode 100644 index 000000000..5bf8fecf3 Binary files /dev/null and b/document_approval/static/description/assets/screenshots/document_approvals_21.png differ diff --git a/document_approval/static/description/assets/screenshots/document_approvals_22.png b/document_approval/static/description/assets/screenshots/document_approvals_22.png new file mode 100644 index 000000000..4dac6455b Binary files /dev/null and b/document_approval/static/description/assets/screenshots/document_approvals_22.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..a10e876c6 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 100755 index 000000000..785d7ec04 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 100755 index 000000000..5f0ded6b2 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 100755 index 000000000..8e7bc94d9 --- /dev/null +++ b/document_approval/static/description/index.html @@ -0,0 +1,762 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+ +

+ Document Approval +

+

+ Approve or Reject Various Documents

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

+ Explore This + Module

+
+ + + + +
+
+ +
+

+ Overview +

+
+
+
+ This module helps you to approve or reject various document submitted + by the + employees from the company .Admin can set team and several steps for + setting approvals +
+
+ + + +
+
+ +
+

+ Features +

+
+
+
+
+ + Approve or reject various documents +
+
+ + Set different team for approvals +
+
+ + Set various steps for approving +
+
+
+
+ + Available in Odoo 16.0 + Community, Enterprise & Odoo sh. +
+
+ + If it needed we can approve it by adding signature +
+
+ + Simple way to manage the documents +
+
+
+ + + +
+
+ +
+

+ Screenshots +

+
+
+
+
+

+ Document approvals +

+

+ Click on the document management app -> Click create + we can see the option to add documents,approving teams , + approval methods,approval status etc +

+ +
+
+

+ Document Approval Sent +

+

+ By clicking SENT FOR APPROVAL,approvals goes into waiting + state

+ +
+
+

+ Approval Wizard +

+

+ Setting method as button and click APPROVE button we can see + the wizard for the approvals +

+ +
+
+

+ Approved Documents +

+

+ By clicking the APPROVE button from the wizard by + adding notes we can see the document has been approved +

+ + +
+
+

+ Approved Teams +

+

+ Go to Configuration -> Approval Team we can see the Approval + Teams +

+ + +
+
+

+ Approved Teams Form View +

+

+ Click create we can set up Approval Team and Approval Steps +

+ +
+
+

+ Approve by Signature +

+

+ From the approvals form view set method as Signature and click the + APPROVE button +

+ +
+
+

+ Approval signature wizard +

+

+ By clicking the approve button we can see a wizard + with signature option put the signature and approve +

+ +
+
+

+ Document Approved with Signature +

+

+ By clicking the approve button we can see the document + has been approved with signature +

+ + +
+
+

+ Document Rejection Wizard +

+

+ By clicking the REJECT button from the document approvals + we can see the wizard for the document rejection.By clicking + REJECT + button from the wizard we can see the document has been set to + rejected state +

+ + +
+
+

+ Document Reject Reasons +

+

+ Go to Document Approval -> Approve/Reject Reason click on the Document Reject Reason menu +

+ + +
+
+

+ Document Approval Description +

+

+ Go to Document Approval -> Approve/Reject Reason click on the Document Approval Description menu +

+ + +
+
+

+ Document Signature Approval Description +

+

+ Go to Document Approval -> Approve/Reject Reason click on the Document Signature Approval Description menu +

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

+ Related + Products +

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

+ Our Services +

+
+
+
+
+
+ +
+
+ Odoo + Customization
+
+
+
+ +
+
+ Odoo + Implementation
+
+
+
+ +
+
+ Odoo + Support
+
+
+
+ +
+
+ Hire + Odoo + Developer
+
+
+
+ +
+
+ Odoo + Integration
+
+
+
+ +
+
+ Odoo + Migration
+
+
+
+ +
+
+ Odoo + Consultancy
+
+
+
+ +
+
+ Odoo + Implementation
+
+
+
+ +
+
+ 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 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ \ No newline at end of file diff --git a/document_approval/views/document_approval_menus.xml b/document_approval/views/document_approval_menus.xml new file mode 100755 index 000000000..aaf3b247e --- /dev/null +++ b/document_approval/views/document_approval_menus.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + 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..12d2c7c72 --- /dev/null +++ b/document_approval/views/document_approval_views.xml @@ -0,0 +1,162 @@ + + + + + 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..c429fcd22 --- /dev/null +++ b/document_approval/wizards/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Sreeshanth V S() +# +# 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..fa8ad114f --- /dev/null +++ b/document_approval/wizards/document_approval_signature.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Sreeshanth V S() +# +# 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..a6105f5bb --- /dev/null +++ b/document_approval/wizards/document_approval_signature_views.xml @@ -0,0 +1,65 @@ + + + + + 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..f3d485232 --- /dev/null +++ b/document_approval/wizards/document_approve.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Sreeshanth V S() +# +# 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..d9b330335 --- /dev/null +++ b/document_approval/wizards/document_approve_views.xml @@ -0,0 +1,59 @@ + + + + + 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..177e76531 --- /dev/null +++ b/document_approval/wizards/document_reject.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Sreeshanth V S() +# +# 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..92fbfaeb6 --- /dev/null +++ b/document_approval/wizards/document_reject_views.xml @@ -0,0 +1,59 @@ + + + + + document.reject.view.form + document.reject + +
+ + + +
+
+
+
+
+ + + document.reject.form.view + document.reject + +
+ + + + + + + + +
+
+
+ + + document.reject.view.tree + document.reject + + + + + + + + + + Document Reject + document.reject + tree,form + + +