diff --git a/enhanced_document_management/README.rst b/enhanced_document_management/README.rst
index b7183ed24..06927b354 100755
--- a/enhanced_document_management/README.rst
+++ b/enhanced_document_management/README.rst
@@ -18,7 +18,7 @@ Company
Credits
-------
-* Developers: V16 Mohamed Savad, Gokul PI, Megha AP, Javid, Nisiya
+* Developers: V16 Mohamed Savad, Gokul PI, Megha AP, Javid, Nisiya, Farhana Jahan PT
* Contact: odoo@cybrosys.com
Contacts
diff --git a/enhanced_document_management/__manifest__.py b/enhanced_document_management/__manifest__.py
index 906a4fc90..620383882 100755
--- a/enhanced_document_management/__manifest__.py
+++ b/enhanced_document_management/__manifest__.py
@@ -21,7 +21,7 @@
#############################################################################
{
'name': 'Document Management',
- 'version': '16.0.1.1.0',
+ 'version': '16.0.1.0.1',
'category': 'Document Management',
'summary': 'The Document Management module to access document tools',
'description': 'The Document Management module provides a quick access to '
diff --git a/enhanced_document_management/doc/RELEASE_NOTES.md b/enhanced_document_management/doc/RELEASE_NOTES.md
index ee33cfaaf..f9153431c 100755
--- a/enhanced_document_management/doc/RELEASE_NOTES.md
+++ b/enhanced_document_management/doc/RELEASE_NOTES.md
@@ -5,3 +5,9 @@
#### ADD
- Initial commit for Document Management
+
+#### 15.03.2024
+#### Version 16.0.1.0.1
+#### ADD
+
+- Updates have been made to the incoming request menu.
diff --git a/enhanced_document_management/models/document_file.py b/enhanced_document_management/models/document_file.py
index 7a2f03f76..0fd87c892 100755
--- a/enhanced_document_management/models/document_file.py
+++ b/enhanced_document_management/models/document_file.py
@@ -102,7 +102,7 @@ class Document(models.Model):
def _compute_size(self):
"""Function is used to fetch the file size of an attachment"""
for rec in self:
- rec.size = str(rec.attachment_id.file_size/1000) + ' Kb'
+ rec.size = str(rec.attachment_id.file_size / 1000) + ' Kb'
@api.onchange('days')
def _onchange_days(self):
@@ -121,12 +121,12 @@ class Document(models.Model):
information about the file"""
# important to maintain extension and name as different
attachment_id = self.env['ir.attachment'].sudo().create({
- 'name': self.name,
- 'datas': self.attachment,
- 'res_model': 'document.file',
- 'res_id': self.id,
- 'public': True,
- })
+ 'name': self.name,
+ 'datas': self.attachment,
+ 'res_model': 'document.file',
+ 'res_id': self.id,
+ 'public': True,
+ })
self.sudo().write({
'name': self.name,
'date': fields.Date.today(),
@@ -138,6 +138,11 @@ class Document(models.Model):
'attachment_id': attachment_id.id,
'brochure_url': attachment_id.local_url
})
+ if self.env.context.get('active_model') == "request.document":
+ self.env['request.document'].search(
+ [('id', '=', self.env.context.get('active_id'))]).write({
+ 'state': 'accepted'
+ })
return {
'type': 'ir.actions.client',
'tag': 'reload'
@@ -150,7 +155,7 @@ class Document(models.Model):
for doc in self.browse(document_selected):
zip_obj.write(doc.attachment_id._full_path(
doc.attachment_id.store_fname),
- doc.attachment_id.name)
+ doc.attachment_id.name)
zip_obj.close()
url = f"{request.httprequest.host_url[:-1]}/web/attachments/download"
return {
diff --git a/enhanced_document_management/models/request_document.py b/enhanced_document_management/models/request_document.py
index f94ec31bf..1b1297037 100755
--- a/enhanced_document_management/models/request_document.py
+++ b/enhanced_document_management/models/request_document.py
@@ -19,7 +19,12 @@
# If not, see .
#
#############################################################################
+import base64
+from io import BytesIO
+import re
+
from odoo import api, fields, models, _
+from odoo.tools import mimetypes
class RequestDocumentUser(models.Model):
@@ -44,6 +49,19 @@ class RequestDocumentUser(models.Model):
company_id = fields.Many2one(
related='workspace_id.company_id', string='Company',
help="Company Name")
+ hide_accept_button = fields.Boolean(string="Accept Upload",
+ help='Boolean for checking the request '
+ 'is accepted or not')
+ hide_accept_for_user_button = fields.Boolean(string="Accept",
+ compute="_compute_hide_accept_for_user_button",
+ help='Boolean for checking '
+ 'the accept button only '
+ 'visible for '
+ 'corresponding users',
+ store=True)
+ boolean_user_default = fields.Boolean(string="User Default",
+ help='Boolean for compute '
+ 'accept button')
def action_send_document_request(self):
"""Function to send document request through email """
@@ -57,6 +75,20 @@ class RequestDocumentUser(models.Model):
'email_to': self.user_id.partner_id.email,
}
self.env['mail.mail'].sudo().create(main_content).send()
+ self.write({
+ 'hide_accept_button': True,
+ })
+
+ def read(self, values):
+ res = super(RequestDocumentUser, self).read(values)
+ self.boolean_user_default = True
+ return res
+
+ @api.depends('boolean_user_default')
+ def _compute_hide_accept_for_user_button(self):
+ for rec in self:
+ if rec.env.uid == rec.user_id.id:
+ rec.hide_accept_for_user_button = True
@api.model
def get_request(self):
@@ -72,3 +104,14 @@ class RequestDocumentUser(models.Model):
'workspace_id': rec.workspace.id,
} for rec in request_ids]
return context
+
+ def action_accept_request(self):
+ return {
+ 'name': _("Upload Document"),
+ 'view_mode': 'form',
+ 'view_type': 'form',
+ 'res_model': 'document.file',
+ 'type': 'ir.actions.act_window',
+ 'target': 'new',
+ 'context': {'default_workspace_id': self.workspace_id.id}
+ }
diff --git a/enhanced_document_management/views/incoming_request_document_views.xml b/enhanced_document_management/views/incoming_request_document_views.xml
index 9f49d292c..380567224 100755
--- a/enhanced_document_management/views/incoming_request_document_views.xml
+++ b/enhanced_document_management/views/incoming_request_document_views.xml
@@ -19,6 +19,13 @@
request.document