Merge pull request #2292 from expsa/samir-aladawi-fix-dms-module

Samir aladawi fix dms module
This commit is contained in:
SamirLADOUI-sa 2025-02-02 13:29:05 +01:00 committed by GitHub
commit 0b515a7197
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 148 additions and 5 deletions

128
odex25_dms/.gitignore vendored Normal file
View File

@ -0,0 +1,128 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
parts/
sdist/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
.python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# github action
.github/workflows/*yaml

View File

@ -289,16 +289,31 @@ class ShareRoute(http.Controller):
return response
@http.route(['/document/zip'], type='http', auth='user')
def get_zip(self, file_ids, zip_name, token=None):
"""route to get the zip file of the selection in the document's Kanban view (Document inspector).
:param file_ids: if of the files to zip.
:param zip_name: name of the zip file.
def get_zip(self, file_ids=None, zip_name=None, token=None, **kwargs):
"""Route to get the zip file of the selection in the document's Kanban view.
:param file_ids: IDs of the files to zip (either comma-separated or list format).
:param zip_name: Name of the zip file.
:param token: Optional token for file tracking.
"""
ids_list = [int(x) for x in file_ids.split(',')]
if not file_ids:
# If file_ids is None, check for list-style query parameters
file_ids = request.httprequest.args.getlist('file_ids[]')
if file_ids:
if isinstance(file_ids, list): # Case: file_ids[]=1262&file_ids[]=1256
ids_list = [int(x) for x in file_ids]
else: # Case: file_ids=1262,1256,1261
ids_list = [int(x) for x in file_ids.split(',')]
else:
ids_list = []
env = request.env
response = self._make_zip(zip_name, env['documents.document'].browse(ids_list))
if token:
response.set_cookie('fileToken', token)
return response
@http.route(["/document/download/all/<int:share_id>/<access_token>"], type='http', auth='public')