diff --git a/document_approval/README.rst b/document_approval/README.rst new file mode 100755 index 000000000..4abc038c5 --- /dev/null +++ b/document_approval/README.rst @@ -0,0 +1,49 @@ +.. 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 +------- +Developers: (V15) Fathima Mazlin AM, + (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..5fe73f2af --- /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: Fathima Mazlin AM() +# +# 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..210c78e4f --- /dev/null +++ b/document_approval/__manifest__.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Fathima Mazlin AM () +# +# 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": "15.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_menus.xml', + 'views/document_approval_team_views.xml', + 'views/document_approval_views.xml', + 'views/res_config_settings_views.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..c38fabe8d --- /dev/null +++ b/document_approval/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 26.08.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..0cb62b9f4 --- /dev/null +++ b/document_approval/models/__init__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author:Fathima Mazlin AM () +# +# 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 +from . import res_config_settings diff --git a/document_approval/models/document_approval.py b/document_approval/models/document_approval.py new file mode 100755 index 000000000..db5c34a9e --- /dev/null +++ b/document_approval/models/document_approval.py @@ -0,0 +1,198 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Fathima Mazlin AM () +# +# 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, ValidationError + + +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.') + team_lead_id = fields.Many2one(string='Team leader', + related='team_id.team_lead_id', + help="team Leader") + 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', 'Approvers')], + string='Visibility', + help='Restrict the visibility of the ' + 'document', default="approvers", + compute='_compute_visibility') + 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.constrains('team_id') + def _check_team_member(self): + """function to check whether the team has atleast one member.""" + if not self.team_id.step_ids.approver_id: + raise ValidationError( + "Your Team member should at least have one Approver.") + + @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() + + def _compute_visibility(self): + for rec in self: + visibility = self.env['ir.config_parameter'].sudo().get_param( + 'document_approval.visibility') + rec.visibility = visibility diff --git a/document_approval/models/document_approval_file.py b/document_approval/models/document_approval_file.py new file mode 100755 index 000000000..bce5d33ea --- /dev/null +++ b/document_approval/models/document_approval_file.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Fathima Mazlin AM () +# +# 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 " + f"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..14911543a --- /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: Fathima Mazlin AM() +# +# 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'), ('rejected', 'Rejected')], + 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..f964792f4 --- /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: Fathima Mazlin AM () +# +# 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/models/res_config_settings.py b/document_approval/models/res_config_settings.py new file mode 100644 index 000000000..1646c54a1 --- /dev/null +++ b/document_approval/models/res_config_settings.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Fathima Mazlin AM (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################### +from odoo import api, fields, models + + +class ResConfigSettings(models.TransientModel): + """Inherit the model res.config.settings to add Additional fields""" + _inherit = 'res.config.settings' + + visibility = fields.Selection( + selection=[('all_user', 'All Users'), ( + 'followers', 'Followers & Approvers'), + ('approvers', 'Approvers')], string='Visibility', + help='Restrict the visibility of the document', default="approvers", + config_parameter='document_approval.visibility', required=True) + + @api.onchange('visibility') + def _onchange_visibility(self): + record_rule = self.env.ref('document_approval.' + 'document_approval_rule_user') + if self.visibility == 'all_user': + record_rule.write({ + 'domain_force': "[(1, '=', 1)]", + }) + elif self.visibility == 'followers': + record_rule.write({ + 'domain_force': "['|','|','|',('step_ids.approver_id.id','='," + "user.id),('approve_initiator_id','='," + "user.id),('team_id.team_lead_id.id','='," + "user.id),('message_partner_ids', 'in', " + "[user.partner_id.id])]", + }) + elif self.visibility == 'approvers': + record_rule.write({ + 'domain_force': "['|','|',('step_ids.approver_id.id','='," + "user.id),('approve_initiator_id','=',user.id)" + ",('team_id.team_lead_id.id','=',user.id)]", + }) diff --git a/document_approval/security/document_approval_security.xml b/document_approval/security/document_approval_security.xml new file mode 100755 index 000000000..bdb7c56f1 --- /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),('team_id.team_lead_id.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 100644 index 000000000..55080c4c8 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 100644 index 000000000..6745a5f19 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 100644 index 000000000..bb4af0b9a 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 100644 index 000000000..3cbfde746 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.png b/document_approval/static/description/assets/modules/5.png new file mode 100644 index 000000000..4b1c4864a Binary files /dev/null and b/document_approval/static/description/assets/modules/5.png differ diff --git a/document_approval/static/description/assets/modules/6.png b/document_approval/static/description/assets/modules/6.png new file mode 100644 index 000000000..d0f506e82 Binary files /dev/null and b/document_approval/static/description/assets/modules/6.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..9931dee2f 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..c132451fb 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..94bb4ddb8 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..6f2b9bd6e Binary files /dev/null and b/document_approval/static/description/assets/screenshots/12.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..44827260e 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..6dfe4421b 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..cd2dbbb9b 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..c9d2fb528 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..5106a02b1 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..59013fb62 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..beec5c931 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..8fc3c2c0c 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..d22786a71 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..77641edec 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..34dfb305e 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..76a54dc8b --- /dev/null +++ b/document_approval/static/description/index.html @@ -0,0 +1,685 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+ +

+ Document Approval

+

+ Approve or Reject Various Documents.

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

+ Explore This + Module

+
+ + + + +
+
+ +
+

+ Overview +

+ This module helps to approve or reject documents. +
+
+
+
+
+ + + +
+
+ +
+

+ Features +

+
+
+
+
+ + Community, Enterprise &Odoo Sh + Support. +
+
+ + Approve or Reject Various Documents. +
+ + Set Different Team for Approvals. +
+ + Signature Approval. +
+
+
+
+
+ + + +
+
+ +
+

+ Screenshots +

+
+
+
+
+

+ Document Approval Menu. +

+

+ + + +

+
+

+ Record Access: + Configuration-> Setting -> Visibility +

+ +
+
+

+ Approval Team Menu +

+
+ +
+ +

+ Form view of Approval Team +

+ + +
+

+ Document Approval +

+ +

+ Document Approval form view +

+

The approvers in an approval team can be automatically listed down when we select that approval team.'Settings' allows you to adjust which records are visible. +

+ +

+ 'SEND FOR APPROVAL' Button for sent the request for approval. +

+ +

+ Approval Request +

+

Selecting "approvers" as the visibility setting means that only the initiator and approvers can view the document. Clicking the "SEND FOR APPROVAL" button causes the state to change to "WAITING." While the document is being approved by each approver, the status is changed to "APPROVED."The status is changed to "REJECTED" if any one of the approvers rejects. +

+ +

+ APPROVE and REJECT Button +

+

The first approver who clicks the "APPROVE" button changes the status to "WAITING." If all approvers give their approval, the status is changed to "APPROVED". The status changes to "REJECTED" if any approver clicks the "REJECT" button. +

+ +

+ APPROVE state +

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

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

+
+
+
+
+
+
+
+ +
+
+
+ diff --git a/document_approval/views/document_approval_menus.xml b/document_approval/views/document_approval_menus.xml new file mode 100755 index 000000000..45d884944 --- /dev/null +++ b/document_approval/views/document_approval_menus.xml @@ -0,0 +1,15 @@ + + + + + + + + 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..0b0f14ec1 --- /dev/null +++ b/document_approval/views/document_approval_team_views.xml @@ -0,0 +1,68 @@ + + + + + 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..76c5c788a --- /dev/null +++ b/document_approval/views/document_approval_views.xml @@ -0,0 +1,160 @@ + + + + + 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/views/res_config_settings_views.xml b/document_approval/views/res_config_settings_views.xml new file mode 100644 index 000000000..787b72f8b --- /dev/null +++ b/document_approval/views/res_config_settings_views.xml @@ -0,0 +1,44 @@ + + + + + res.config.settings.view.form.inherit.document.approval + res.config.settings + + + + +
+

Document Approval

+
+
+
+
+
+
+
+
+
+
+ + + Settings + res.config.settings + form + + inline + {'module' : 'document_approval','bin_size':False} + + + +
diff --git a/document_approval/wizards/__init__.py b/document_approval/wizards/__init__.py new file mode 100755 index 000000000..725faf98f --- /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: Fathima Mazlin AM () +# +# 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..f247981bf --- /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: Fathima Mazlin AM () +# +# 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..3f2f9d9db --- /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..6fac367b1 --- /dev/null +++ b/document_approval/wizards/document_approve.py @@ -0,0 +1,75 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Fathima Mazlin AM() +# +# 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..333fda688 --- /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..40a82acf8 --- /dev/null +++ b/document_approval/wizards/document_reject.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Fathima Mazlin AM () +# +# 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" + for rec in self.document_id.step_ids.filtered( + lambda x: x.approver_id.id == self.env.user.id): + rec.write({ + 'current_state': 'rejected', + }) diff --git a/document_approval/wizards/document_reject_views.xml b/document_approval/wizards/document_reject_views.xml new file mode 100755 index 000000000..652a1ab08 --- /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 + + + +