From 2083a77f18a1c56fbe81762c09d2664e96d8bcb1 Mon Sep 17 00:00:00 2001 From: Shijin V Date: Wed, 10 Jan 2024 12:24:44 +0530 Subject: [PATCH] Jan 10: [UPDT] Added company record rule 'enhanced_document_management' --- enhanced_document_management/__manifest__.py | 2 +- .../doc/RELEASE_NOTES.md | 2 +- .../models/document_file.py | 3 ++ .../models/document_trash.py | 3 ++ .../models/request_document.py | 3 ++ .../enhanced_document_management_security.xml | 48 +++++++++++++++++++ .../views/document_file_views.xml | 23 ++++----- .../views/document_trash_views.xml | 1 + .../views/incoming_request_document_views.xml | 1 + 9 files changed, 73 insertions(+), 13 deletions(-) diff --git a/enhanced_document_management/__manifest__.py b/enhanced_document_management/__manifest__.py index b60e50e25..906a4fc90 100755 --- a/enhanced_document_management/__manifest__.py +++ b/enhanced_document_management/__manifest__.py @@ -21,7 +21,7 @@ ############################################################################# { 'name': 'Document Management', - 'version': '16.0.1.0.0', + 'version': '16.0.1.1.0', '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 0c14db6b2..ee33cfaaf 100755 --- a/enhanced_document_management/doc/RELEASE_NOTES.md +++ b/enhanced_document_management/doc/RELEASE_NOTES.md @@ -1,6 +1,6 @@ ## Module -#### 08.01.2024 +#### 10.01.2024 #### Version 16.0.1.0.0 #### ADD diff --git a/enhanced_document_management/models/document_file.py b/enhanced_document_management/models/document_file.py index f232d2cab..7a2f03f76 100755 --- a/enhanced_document_management/models/document_file.py +++ b/enhanced_document_management/models/document_file.py @@ -94,6 +94,9 @@ class Document(models.Model): size = fields.Char( string='Size', compute='_compute_size', help="it store size of the document") + company_id = fields.Many2one( + related='workspace_id.company_id', string='Company', + help="Company Name") @api.depends('attachment_id') def _compute_size(self): diff --git a/enhanced_document_management/models/document_trash.py b/enhanced_document_management/models/document_trash.py index 39f617945..1e6451345 100755 --- a/enhanced_document_management/models/document_trash.py +++ b/enhanced_document_management/models/document_trash.py @@ -100,6 +100,9 @@ class DocumentTrash(models.Model): string="File URL", help="""it store url while adding an url document""" ) size = fields.Char(string="Size", help="it store size of the document") + company_id = fields.Many2one( + related='workspace_id.company_id', string='Company', + help="Company Name") def delete_doc(self): """Function to delete all the documents after the trash date""" diff --git a/enhanced_document_management/models/request_document.py b/enhanced_document_management/models/request_document.py index 636f6184f..f94ec31bf 100755 --- a/enhanced_document_management/models/request_document.py +++ b/enhanced_document_management/models/request_document.py @@ -41,6 +41,9 @@ class RequestDocumentUser(models.Model): ('requested', 'Requested'), ('accepted', 'Accepted'), ('rejected', 'Rejected')], default='requested') + company_id = fields.Many2one( + related='workspace_id.company_id', string='Company', + help="Company Name") def action_send_document_request(self): """Function to send document request through email """ diff --git a/enhanced_document_management/security/enhanced_document_management_security.xml b/enhanced_document_management/security/enhanced_document_management_security.xml index cb056adc8..06e1d9a42 100755 --- a/enhanced_document_management/security/enhanced_document_management_security.xml +++ b/enhanced_document_management/security/enhanced_document_management_security.xml @@ -62,4 +62,52 @@ + + + + Documents multy-company + + ['|',('company_id', '=',False),('company_id', 'in', company_ids)] + + + + + + + + + + Document workspace multy-company + + ['|',('company_id', '=',False),('company_id', 'in', company_ids)] + + + + + + + + + + Document trash multy-company + + ['|',('company_id', '=',False),('company_id', 'in', company_ids)] + + + + + + + + + + Document requests multy-company + + ['|',('company_id', '=',False),('company_id', 'in', company_ids)] + + + + + + diff --git a/enhanced_document_management/views/document_file_views.xml b/enhanced_document_management/views/document_file_views.xml index 2b0292ba4..ba7544f69 100755 --- a/enhanced_document_management/views/document_file_views.xml +++ b/enhanced_document_management/views/document_file_views.xml @@ -57,69 +57,69 @@ + t-att-data-id="record.id.value" alt="xlsx file"/> + t-att-data-id="record.id.value" alt="pdf file"/> + t-att-data-id="record.id.value" alt="txt file"/> + t-att-data-id="record.id.value" alt="pptx file"/> + t-att-data-id="record.id.value" alt="url file"/> + t-att-data-id="record.id.value" alt="docx file"/> + t-att-data-id="record.id.value" alt="jpg file"/> + t-att-data-id="record.id.value" alt="jpeg file"/> + t-att-data-id="record.id.value" alt="png file"/> + t-att-data-id="record.id.value" alt="csv file"/> + t-att-data-id="record.id.value" alt="other file"/> @@ -198,6 +198,7 @@ + diff --git a/enhanced_document_management/views/document_trash_views.xml b/enhanced_document_management/views/document_trash_views.xml index 3627e76dc..804cde9f2 100755 --- a/enhanced_document_management/views/document_trash_views.xml +++ b/enhanced_document_management/views/document_trash_views.xml @@ -36,6 +36,7 @@ + diff --git a/enhanced_document_management/views/incoming_request_document_views.xml b/enhanced_document_management/views/incoming_request_document_views.xml index d6047112a..9f49d292c 100755 --- a/enhanced_document_management/views/incoming_request_document_views.xml +++ b/enhanced_document_management/views/incoming_request_document_views.xml @@ -26,6 +26,7 @@ +