diff --git a/document_approval/__manifest__.py b/document_approval/__manifest__.py index 959cb7eb5..c2dba6a41 100755 --- a/document_approval/__manifest__.py +++ b/document_approval/__manifest__.py @@ -21,7 +21,7 @@ ############################################################################# { 'name': "Document Approval", - "version": "17.0.1.0.0", + "version": "17.0.1.0.1", "category": "Documents Management", "summary": "Manager can approve or reject documents", "description": "User can create and upload various document for approvals." diff --git a/document_approval/doc/RELEASE_NOTES.md b/document_approval/doc/RELEASE_NOTES.md index efce2b79f..0ae466c46 100755 --- a/document_approval/doc/RELEASE_NOTES.md +++ b/document_approval/doc/RELEASE_NOTES.md @@ -4,3 +4,9 @@ #### Version 17.0.1.0.0 #### ADD - Initial commit for Document Approval + + +#### 22.07.2024 +#### Version 17.0.1.0.1 +#### BUG FIX +- Bug Fix \ No newline at end of file diff --git a/document_approval/models/document_approval.py b/document_approval/models/document_approval.py index 7232a778f..fc35f1f26 100755 --- a/document_approval/models/document_approval.py +++ b/document_approval/models/document_approval.py @@ -20,7 +20,7 @@ # ############################################################################# from odoo import api, fields, models, _ -from odoo.exceptions import UserError +from odoo.exceptions import UserError, ValidationError class DocumentApproval(models.Model): @@ -43,6 +43,9 @@ class DocumentApproval(models.Model): 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", @@ -97,6 +100,13 @@ class DocumentApproval(models.Model): '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 atleast have one Approver.") + @api.depends('team_id') def _compute_show_approve(self): """This method _compute_show_approve to compute the valur to the field diff --git a/document_approval/models/document_approval_step.py b/document_approval/models/document_approval_step.py index 1979b9ce7..4e6295983 100755 --- a/document_approval/models/document_approval_step.py +++ b/document_approval/models/document_approval_step.py @@ -52,6 +52,6 @@ class DocumentApprovalSteps(models.Model): note = fields.Char(string='Notes', help="To add notes") current_state = fields.Selection( selection=[('upcoming', 'Upcoming'), ('pending', 'Pending'), - ('approved', 'Approved')], + ('approved', 'Approved'), ('rejected', 'Rejected')], default="upcoming", string="Approval State", help="THe current state of approval") diff --git a/document_approval/security/document_approval_security.xml b/document_approval/security/document_approval_security.xml index 0ea5b47c7..bdb7c56f1 100755 --- a/document_approval/security/document_approval_security.xml +++ b/document_approval/security/document_approval_security.xml @@ -6,7 +6,7 @@ - ['|',('step_ids.approver_id.id','=',user.id),('approve_initiator_id','=',user.id)] + ['|','|',('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/static/description/assets/screenshots/16.png b/document_approval/static/description/assets/screenshots/16.png new file mode 100644 index 000000000..5c26f6a26 Binary files /dev/null and b/document_approval/static/description/assets/screenshots/16.png differ diff --git a/document_approval/static/description/assets/screenshots/17.png b/document_approval/static/description/assets/screenshots/17.png new file mode 100644 index 000000000..d3ac23358 Binary files /dev/null and b/document_approval/static/description/assets/screenshots/17.png differ diff --git a/document_approval/static/description/assets/screenshots/18.png b/document_approval/static/description/assets/screenshots/18.png new file mode 100644 index 000000000..c517a4cef Binary files /dev/null and b/document_approval/static/description/assets/screenshots/18.png differ diff --git a/document_approval/static/description/assets/screenshots/19.png b/document_approval/static/description/assets/screenshots/19.png new file mode 100644 index 000000000..0a4b6ab83 Binary files /dev/null and b/document_approval/static/description/assets/screenshots/19.png differ diff --git a/document_approval/static/description/assets/screenshots/20.png b/document_approval/static/description/assets/screenshots/20.png new file mode 100644 index 000000000..74bcb1bc6 Binary files /dev/null and b/document_approval/static/description/assets/screenshots/20.png differ diff --git a/document_approval/static/description/assets/screenshots/21.png b/document_approval/static/description/assets/screenshots/21.png new file mode 100644 index 000000000..aa06b0522 Binary files /dev/null and b/document_approval/static/description/assets/screenshots/21.png differ diff --git a/document_approval/static/description/assets/screenshots/22.png b/document_approval/static/description/assets/screenshots/22.png new file mode 100644 index 000000000..74656065c Binary files /dev/null and b/document_approval/static/description/assets/screenshots/22.png differ diff --git a/document_approval/static/description/index.html b/document_approval/static/description/index.html index cc7c22480..9a795d8e3 100644 --- a/document_approval/static/description/index.html +++ b/document_approval/static/description/index.html @@ -47,7 +47,8 @@ #1A202C;"> Document Approval

Approve or Reject Various Documents. + style="max-width: 80%; font-weight: 400 !important; line-height: 32px; color: #718096;"> + Approve or Reject Various Documents.

Approve or Reject Various Documents.

+ font-size: 1.2rem; margin-bottom: 2px;"> + Approve or Reject Various Documents.

@@ -109,7 +111,7 @@

- Set Various Steps for Approving.

+ Set Various Steps for Approving.

@@ -126,7 +128,7 @@

- Signature Approval.

+ Signature Approval.

@@ -221,7 +223,8 @@

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

+ Approval Form View. Click on the 'Send for + Approval' Button for Approval Request.
@@ -239,9 +242,13 @@ style=" font-weight:600 !important; color:#282F33 !important; font-size:1.3rem !important"> Button Approval.

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

@@ -262,6 +269,87 @@ +
+
+
+ +
+
+

+ Step Wise Approval

+

+ We can Configure A team for step-wise + approval

+
+
+
+
+
+
+ +
+
+

+ We can create an Approval And check the work + flow

+
+
+
+
+
+
+ +
+
+

+ If the Team Lead Approves the request, it + Will directly go to Approved Stage.

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

+ Team members will be assigned approval + requests based on the structured sequence of + steps.

+
+
+

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

@@ -308,7 +402,8 @@

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

+ After confirming the approval the state is + changed to the 'Approved'.
@@ -340,7 +435,8 @@

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

+ We can add the Description/Reason for the + Approval Rejection.
@@ -372,7 +468,8 @@

- Document Signature Approval Description.

+ Document Signature Approval + Description.
@@ -417,21 +514,24 @@ Approve or Reject Various Documents. + width="16px">Approve or + Reject Various Documents.
  • Set Different Team for Approvals. + width="16px">Set Different + Team for Approvals.
  • Set Various Steps for Approving. + width="16px">Set Various + Steps for Approving.
  • @@ -454,14 +554,16 @@
    -
    +
    Version 17.0.1.0.0|Released on:01st Apr 2024
    -

    +

    Initial commit for Document Approval

    @@ -524,7 +626,7 @@

    - Size Restriction For Attachments

    + Size Restriction For Attachments

    diff --git a/document_approval/views/document_approval_team_views.xml b/document_approval/views/document_approval_team_views.xml index 45ee477f3..ad3ab48ee 100755 --- a/document_approval/views/document_approval_team_views.xml +++ b/document_approval/views/document_approval_team_views.xml @@ -31,10 +31,10 @@ - + - diff --git a/document_approval/views/document_approval_views.xml b/document_approval/views/document_approval_views.xml index 033781d6f..dd77344d4 100755 --- a/document_approval/views/document_approval_views.xml +++ b/document_approval/views/document_approval_views.xml @@ -73,6 +73,7 @@ + @@ -94,6 +95,7 @@ decoration-success="current_state == 'approved'" decoration-primary="current_state == 'pending'" decoration-warning="current_state == 'upcoming'" + decoration-danger="current_state == 'rejected'" column_invisible="parent.state == 'draft'"/> diff --git a/document_approval/wizards/document_reject.py b/document_approval/wizards/document_reject.py index dde515ac3..9acfd50a8 100755 --- a/document_approval/wizards/document_reject.py +++ b/document_approval/wizards/document_reject.py @@ -36,3 +36,9 @@ class DocumentReject(models.TransientModel): 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', + }) +