mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-13 07:24:48 -06:00
[MIG] attachment_zipped_download: Migration to 17.0
TT52268 [UPD] Update attachment_zipped_download.pot [BOT] post-merge updates Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: knowledge-17.0/knowledge-17.0-attachment_zipped_download Translate-URL: https://translation.odoo-community.org/projects/knowledge-17-0/knowledge-17-0-attachment_zipped_download/
This commit is contained in:
parent
422c64a40e
commit
7e256cfaa8
@ -7,7 +7,7 @@ Attachment Zipped Download
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! source digest: sha256:4163544eb16787f39f46edcd97305586594a6f708c1e489908d344467c82483e
|
||||
!! source digest: sha256:63602db7f612916c91796c11238e746b60396e495f8df6bb7f4bcbff442e56d1
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
||||
@ -148,13 +148,13 @@ Authors
|
||||
Contributors
|
||||
------------
|
||||
|
||||
- César Fernández Domínguez <cesfernandez@outlook.com>
|
||||
- `Tecnativa <https://www.tecnativa.com>`__:
|
||||
- César Fernández Domínguez <cesfernandez@outlook.com>
|
||||
- `Tecnativa <https://www.tecnativa.com>`__:
|
||||
|
||||
- Víctor Martínez
|
||||
- Pedro M. Baeza
|
||||
- Víctor Martínez
|
||||
- Pedro M. Baeza
|
||||
|
||||
- Pierre Verkest <pierreverkest@gmail.com>
|
||||
- Pierre Verkest <pierreverkest@gmail.com>
|
||||
|
||||
Maintainers
|
||||
-----------
|
||||
|
@ -2,7 +2,7 @@
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
{
|
||||
"name": "Attachment Zipped Download",
|
||||
"version": "16.0.2.0.2",
|
||||
"version": "17.0.1.0.0",
|
||||
"category": "Tools",
|
||||
"website": "https://github.com/OCA/knowledge",
|
||||
"author": "Tecnativa, Odoo Community Association (OCA)",
|
||||
|
@ -4,7 +4,7 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 16.0\n"
|
||||
"Project-Id-Version: Odoo Server 17.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
|
@ -68,12 +68,3 @@ msgstr "No se encontró ningún documento para descargar."
|
||||
#, python-format
|
||||
msgid "attachments.zip"
|
||||
msgstr "adjuntos.zip"
|
||||
|
||||
#~ msgid "Display Name"
|
||||
#~ msgstr "Nombre mostrado"
|
||||
|
||||
#~ msgid "ID"
|
||||
#~ msgstr "ID"
|
||||
|
||||
#~ msgid "Last Modified on"
|
||||
#~ msgstr "Última modificación el"
|
||||
|
@ -63,9 +63,3 @@ msgstr "Aucune pièce jointe téléchargeable trouvé."
|
||||
#, python-format
|
||||
msgid "attachments.zip"
|
||||
msgstr "pieces-jointes.zip"
|
||||
|
||||
#~ msgid "Display Name"
|
||||
#~ msgstr "Nom affiché"
|
||||
|
||||
#~ msgid "Last Modified on"
|
||||
#~ msgstr "Dernière modification le"
|
||||
|
@ -13,8 +13,8 @@ msgstr ""
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
|
||||
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
|
||||
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
|
||||
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
|
||||
"X-Generator: Weblate 4.14.1\n"
|
||||
|
||||
#. module: attachment_zipped_download
|
||||
|
@ -64,12 +64,3 @@ msgstr "Non sono stati trovati documenti da scaricare."
|
||||
#, python-format
|
||||
msgid "attachments.zip"
|
||||
msgstr "attachments.zip"
|
||||
|
||||
#~ msgid "Display Name"
|
||||
#~ msgstr "Nome visualizzato"
|
||||
|
||||
#~ msgid "ID"
|
||||
#~ msgstr "ID"
|
||||
|
||||
#~ msgid "Last Modified on"
|
||||
#~ msgstr "Ultima modifica il"
|
||||
|
@ -367,7 +367,7 @@ ul.auto-toc {
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! source digest: sha256:4163544eb16787f39f46edcd97305586594a6f708c1e489908d344467c82483e
|
||||
!! source digest: sha256:63602db7f612916c91796c11238e746b60396e495f8df6bb7f4bcbff442e56d1
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/knowledge/tree/17.0/attachment_zipped_download"><img alt="OCA/knowledge" src="https://img.shields.io/badge/github-OCA%2Fknowledge-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/knowledge-17-0/knowledge-17-0-attachment_zipped_download"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/knowledge&target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
|
||||
<p>This module allows downloading multiple attachments as a zip file.</p>
|
||||
|
@ -1,17 +1,18 @@
|
||||
# Copyright 2022-2023 Tecnativa - Víctor Martínez
|
||||
# Copyright 2022-2024 Tecnativa - Víctor Martínez
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
import base64
|
||||
from unittest import TestCase
|
||||
|
||||
from odoo.exceptions import AccessError
|
||||
from odoo.tests import HttpCase, SavepointCase, new_test_user
|
||||
from odoo.tests import HttpCase, new_test_user
|
||||
|
||||
from odoo.addons.base.tests.common import BaseCommon
|
||||
|
||||
|
||||
class TestAttachmentZippedDownloadBase(TestCase):
|
||||
class TestAttachmentZippedDownloadBase(BaseCommon):
|
||||
@classmethod
|
||||
def _create_attachment(cls, env, user, name, model=False, res_id=False):
|
||||
def _create_attachment(cls, user, name, model=False, res_id=False):
|
||||
return (
|
||||
env["ir.attachment"]
|
||||
cls.env["ir.attachment"]
|
||||
.with_user(user)
|
||||
.create(
|
||||
{
|
||||
@ -25,22 +26,13 @@ class TestAttachmentZippedDownloadBase(TestCase):
|
||||
|
||||
|
||||
class TestAttachmentZippedDownload(HttpCase, TestAttachmentZippedDownloadBase):
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
ctx = {
|
||||
"mail_create_nolog": True,
|
||||
"mail_create_nosubscribe": True,
|
||||
"mail_notrack": True,
|
||||
"no_reset_password": True,
|
||||
}
|
||||
self.user = new_test_user(
|
||||
self.env,
|
||||
login="test-user",
|
||||
context=ctx,
|
||||
)
|
||||
test_1 = self._create_attachment(self.env, self.user, "test1.txt")
|
||||
test_2 = self._create_attachment(self.env, self.user, "test2.txt")
|
||||
self.attachments = test_1 + test_2
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
cls.user = new_test_user(cls.env, login="test-user")
|
||||
test_1 = cls._create_attachment(cls.user, "test1.txt")
|
||||
test_2 = cls._create_attachment(cls.user, "test2.txt")
|
||||
cls.attachments = test_1 + test_2
|
||||
|
||||
def test_action_attachments_download(self):
|
||||
self.authenticate("test-user", "test-user")
|
||||
@ -49,27 +41,19 @@ class TestAttachmentZippedDownload(HttpCase, TestAttachmentZippedDownloadBase):
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
|
||||
class TestAttachmentZipped(SavepointCase, TestAttachmentZippedDownloadBase):
|
||||
class TestAttachmentZipped(TestAttachmentZippedDownloadBase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
ctx = {
|
||||
"mail_create_nolog": True,
|
||||
"mail_create_nosubscribe": True,
|
||||
"mail_notrack": True,
|
||||
"no_reset_password": True,
|
||||
}
|
||||
cls.user = new_test_user(
|
||||
cls.env,
|
||||
login="test-user",
|
||||
password="test-user",
|
||||
groups="base.group_user,base.group_partner_manager",
|
||||
context=ctx,
|
||||
)
|
||||
test_1 = cls._create_attachment(cls.env, cls.user, "test1.txt")
|
||||
test_2 = cls._create_attachment(cls.env, cls.user, "test2.txt")
|
||||
test_1 = cls._create_attachment(cls.user, "test1.txt")
|
||||
test_2 = cls._create_attachment(cls.user, "test2.txt")
|
||||
test_3 = cls._create_attachment(
|
||||
cls.env,
|
||||
cls.user,
|
||||
"test3.txt",
|
||||
model="res.partner",
|
||||
@ -83,7 +67,6 @@ class TestAttachmentZipped(SavepointCase, TestAttachmentZippedDownloadBase):
|
||||
|
||||
def test_create_temp_zip_access_denined(self):
|
||||
attachments = self.attachments | self._create_attachment(
|
||||
self.env,
|
||||
self.uid,
|
||||
"test4.txt",
|
||||
model="ir.ui.view",
|
||||
|
@ -3,12 +3,10 @@
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
from odoo_test_helper import FakeModelLoader
|
||||
|
||||
from odoo.tests import SavepointCase
|
||||
|
||||
from .test_attachment_zipped_download import TestAttachmentZippedDownloadBase
|
||||
|
||||
|
||||
class TestMixin(SavepointCase, TestAttachmentZippedDownloadBase):
|
||||
class TestMixin(TestAttachmentZippedDownloadBase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
@ -21,26 +19,23 @@ class TestMixin(SavepointCase, TestAttachmentZippedDownloadBase):
|
||||
|
||||
cls.loader.update_registry((ResPartner,))
|
||||
|
||||
cls.partner_1 = cls.env.ref("base.res_partner_1")
|
||||
cls.partner_2 = cls.env.ref("base.res_partner_2")
|
||||
cls.partner_3 = cls.env.ref("base.res_partner_3")
|
||||
cls.partner_1 = cls.env["res.partner"].create({"name": "Test partner 1"})
|
||||
cls.partner_2 = cls.env["res.partner"].create({"name": "Test partner 2"})
|
||||
cls.partner_3 = cls.env["res.partner"].create({"name": "Test partner 3"})
|
||||
|
||||
cls.partner_1_f1 = cls._create_attachment(
|
||||
cls.env,
|
||||
cls.env.uid,
|
||||
"partner_1-f1.txt",
|
||||
model="res.partner",
|
||||
res_id=cls.partner_1.id,
|
||||
)
|
||||
cls.partner_1_f2 = cls._create_attachment(
|
||||
cls.env,
|
||||
cls.env.uid,
|
||||
"partner_1-f2.txt",
|
||||
model="res.partner",
|
||||
res_id=cls.partner_1.id,
|
||||
)
|
||||
cls.partner_2_f1 = cls._create_attachment(
|
||||
cls.env,
|
||||
cls.env.uid,
|
||||
"partner_2-f1.txt",
|
||||
model="res.partner",
|
||||
|
Loading…
Reference in New Issue
Block a user