From 7c6442322cb1b10cb8cba492ff8c5b16285915b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20BEAU?= Date: Thu, 7 Jun 2018 19:28:47 +0200 Subject: [PATCH 01/30] [REF] refactor product_media and split it in two module storage_media and storage_media_product --- storage_media/README.rst | 55 +++++++++++ storage_media/__init__.py | 3 + storage_media/__manifest__.py | 34 +++++++ storage_media/data/ir_parameter.xml | 11 +++ storage_media/models/__init__.py | 5 + storage_media/models/storage_file.py | 12 +++ storage_media/models/storage_media.py | 60 ++++++++++++ storage_media/security/ir.model.access.csv | 7 ++ storage_media/security/ir_rule.xml | 11 +++ storage_media/security/res_group.xml | 9 ++ storage_media/views/storage_media_view.xml | 108 +++++++++++++++++++++ 11 files changed, 315 insertions(+) create mode 100644 storage_media/README.rst create mode 100644 storage_media/__init__.py create mode 100644 storage_media/__manifest__.py create mode 100644 storage_media/data/ir_parameter.xml create mode 100644 storage_media/models/__init__.py create mode 100644 storage_media/models/storage_file.py create mode 100644 storage_media/models/storage_media.py create mode 100644 storage_media/security/ir.model.access.csv create mode 100644 storage_media/security/ir_rule.xml create mode 100644 storage_media/security/res_group.xml create mode 100644 storage_media/views/storage_media_view.xml diff --git a/storage_media/README.rst b/storage_media/README.rst new file mode 100644 index 0000000000..ee8345a5f9 --- /dev/null +++ b/storage_media/README.rst @@ -0,0 +1,55 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +============== +Storage Media +============== + +This module add the possibilty to store media (with specific tag/typology) on a public +storage in order to make them accessible on the web for your customer + +Installation +============ + +Nothing special required + + +Configuration +============= + +Install the module and configure your storage (see storage module) + +Usage +===== + +Go on the storage form and add a media + +Known issues / Roadmap +====================== + +* Nothing + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smashing it by providing a detailed and welcomed feedback. + +Credits +======= + +Contributors +------------ + +* Sebastien Beau + +Funders +------- + +The development of this module has been financially supported by: + +* Akretion R&D +* Adaptoo diff --git a/storage_media/__init__.py b/storage_media/__init__.py new file mode 100644 index 0000000000..cde864bae2 --- /dev/null +++ b/storage_media/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import models diff --git a/storage_media/__manifest__.py b/storage_media/__manifest__.py new file mode 100644 index 0000000000..7a2a52b8df --- /dev/null +++ b/storage_media/__manifest__.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Akretion (http://www.akretion.com). +# @author Sébastien BEAU +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Storage Media", + "summary": "Give the posibility to store media data in Odoo", + "version": "10.0.1.0.0", + "category": "Uncategorized", + "website": "www.akretion.com", + "author": " Akretion", + "license": "AGPL-3", + "application": False, + 'installable': True, + "external_dependencies": { + "python": [], + "bin": [], + }, + "depends": [ + "storage_file", + ], + "data": [ + "views/storage_media_view.xml", + "data/ir_parameter.xml", + "security/res_group.xml", + "security/ir_rule.xml", + "security/ir.model.access.csv", + ], + "demo": [ + ], + "qweb": [ + ] +} diff --git a/storage_media/data/ir_parameter.xml b/storage_media/data/ir_parameter.xml new file mode 100644 index 0000000000..d797b8baeb --- /dev/null +++ b/storage_media/data/ir_parameter.xml @@ -0,0 +1,11 @@ + + + + + + storage.media.backend_id + + + + + diff --git a/storage_media/models/__init__.py b/storage_media/models/__init__.py new file mode 100644 index 0000000000..a1df02dc6c --- /dev/null +++ b/storage_media/models/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- + +from . import storage_file +from . import storage_media + diff --git a/storage_media/models/storage_file.py b/storage_media/models/storage_file.py new file mode 100644 index 0000000000..1ad8e2db0e --- /dev/null +++ b/storage_media/models/storage_file.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Akretion (http://www.akretion.com). +# @author Sébastien BEAU +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class StorageFile(models.Model): + _inherit = 'storage.file' + + file_type = fields.Selection(selection_add=[('media', 'Media')]) diff --git a/storage_media/models/storage_media.py b/storage_media/models/storage_media.py new file mode 100644 index 0000000000..b4f984bfa1 --- /dev/null +++ b/storage_media/models/storage_media.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Akretion (http://www.akretion.com). +# @author Sébastien BEAU +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +import os +from odoo import api, fields, models +import logging +_logger = logging.getLogger(__name__) + +try: + from slugify import slugify +except ImportError, err: + _logger.debug(err) + + +class MediaType(models.Model): + _name = 'storage.media.type' + _description = 'Storage Media Type' + + name = fields.Char(translated=True, required=True) + code = fields.Char() + + +class StorageMedia(models.Model): + _name = 'storage.media' + _description = 'Storage Media' + _inherits = {'storage.file': 'file_id'} + + file_id = fields.Many2one( + 'storage.file', + 'File', + required=True, + ondelete='cascade') + media_type_id = fields.Many2one( + 'storage.media.type', + 'Media Type') + + @api.onchange('name') + def onchange_name(self): + for record in self: + if record.name: + filename, extension = os.path.splitext(record.name) + record.name = "%s%s" % (slugify(filename), extension) + + @api.model + def create(self, vals): + vals['file_type'] = 'media' + if 'backend_id' not in vals: + vals['backend_id'] = self._get_backend_id() + return super(StorageMedia, self).create(vals) + + def _get_backend_id(self): + """Choose the correct backend. + + By default : it's the one configured as ir.config_parameter + Overload this method if you need something more powerfull + """ + return int(self.env['ir.config_parameter'].get_param( + 'storage.media.backend_id')) diff --git a/storage_media/security/ir.model.access.csv b/storage_media/security/ir.model.access.csv new file mode 100644 index 0000000000..15dddd77a7 --- /dev/null +++ b/storage_media/security/ir.model.access.csv @@ -0,0 +1,7 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_storage_media_edit,storage_media edit,model_storage_media,group_media_manager,1,1,1,1 +access_storage_file_media_edit,storage_file media edit,storage_file.model_storage_file,group_media_manager,1,1,1,1 +access_storage_thumbnail_edit,storage_thumbnail edit,storage_thumbnail.model_storage_thumbnail,group_media_manager,1,1,1,1 +access_storage_media_read,storage_media read,model_storage_media,base.group_user,1,0,0,0 +access_storage_media_type_edit,storage_media_type edit,model_storage_media_type,base.group_system,1,1,1,1 +access_storage_media_type_read,storage_media_type read,model_storage_media_type,base.group_user,1,0,0,0 diff --git a/storage_media/security/ir_rule.xml b/storage_media/security/ir_rule.xml new file mode 100644 index 0000000000..50f2f7e063 --- /dev/null +++ b/storage_media/security/ir_rule.xml @@ -0,0 +1,11 @@ + + + + + Storage File for Media + + [('file_type','=', 'media')] + + + + diff --git a/storage_media/security/res_group.xml b/storage_media/security/res_group.xml new file mode 100644 index 0000000000..984de2a83c --- /dev/null +++ b/storage_media/security/res_group.xml @@ -0,0 +1,9 @@ + + + + + Storage Media Manager + + + + diff --git a/storage_media/views/storage_media_view.xml b/storage_media/views/storage_media_view.xml new file mode 100644 index 0000000000..a17813eada --- /dev/null +++ b/storage_media/views/storage_media_view.xml @@ -0,0 +1,108 @@ + + + + + storage.media + + + + + + + + + + storage.media + +
+ + + + + + + +
+
+
+ + + storage.media.type + + + + + + + + + + storage.media.type + +
+ + + + +
+
+
+ + + storage.media.type + + + + + + + + + + Storage Media Type + ir.actions.act_window + storage.media.type + form + tree,form + + [] + {} + + + + + + form + + + + + + + tree + + + + + + + Storage Media + storage.media + form + tree,form + + + + +
From be17333cf5ef597d1b838af1caae5f85c24b9cb8 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Mon, 11 Jun 2018 21:20:31 +0200 Subject: [PATCH 02/30] [WIP] fix import ; [REF] add a file per model --- storage_media/__manifest__.py | 1 + storage_media/models/__init__.py | 2 +- storage_media/models/storage_media.py | 14 +++----------- storage_media/models/storage_media_type.py | 14 ++++++++++++++ 4 files changed, 19 insertions(+), 12 deletions(-) create mode 100644 storage_media/models/storage_media_type.py diff --git a/storage_media/__manifest__.py b/storage_media/__manifest__.py index 7a2a52b8df..42c28b8e05 100644 --- a/storage_media/__manifest__.py +++ b/storage_media/__manifest__.py @@ -19,6 +19,7 @@ }, "depends": [ "storage_file", + "storage_thumbnail", ], "data": [ "views/storage_media_view.xml", diff --git a/storage_media/models/__init__.py b/storage_media/models/__init__.py index a1df02dc6c..a74dc3b476 100644 --- a/storage_media/models/__init__.py +++ b/storage_media/models/__init__.py @@ -2,4 +2,4 @@ from . import storage_file from . import storage_media - +from . import storage_media_type diff --git a/storage_media/models/storage_media.py b/storage_media/models/storage_media.py index b4f984bfa1..ecb534e0a8 100644 --- a/storage_media/models/storage_media.py +++ b/storage_media/models/storage_media.py @@ -10,16 +10,8 @@ try: from slugify import slugify -except ImportError, err: - _logger.debug(err) - - -class MediaType(models.Model): - _name = 'storage.media.type' - _description = 'Storage Media Type' - - name = fields.Char(translated=True, required=True) - code = fields.Char() +except ImportError: + _logger.debug('Cannot `import slugify`.') class StorageMedia(models.Model): @@ -48,7 +40,7 @@ def create(self, vals): vals['file_type'] = 'media' if 'backend_id' not in vals: vals['backend_id'] = self._get_backend_id() - return super(StorageMedia, self).create(vals) + return super(StorageMedia, self).create(vals) def _get_backend_id(self): """Choose the correct backend. diff --git a/storage_media/models/storage_media_type.py b/storage_media/models/storage_media_type.py new file mode 100644 index 0000000000..582e03d9db --- /dev/null +++ b/storage_media/models/storage_media_type.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Akretion (http://www.akretion.com). +# @author Sébastien BEAU +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class MediaType(models.Model): + _name = 'storage.media.type' + _description = 'Storage Media Type' + + name = fields.Char(translated=True, required=True) + code = fields.Char() From 2100112fb83cdb3a69c053bf146f577f6b9c0844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20BEAU?= Date: Fri, 15 Feb 2019 17:02:31 +0100 Subject: [PATCH 03/30] [FIX] fix missing noupdate --- storage_media/data/ir_parameter.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage_media/data/ir_parameter.xml b/storage_media/data/ir_parameter.xml index d797b8baeb..8f32b42299 100644 --- a/storage_media/data/ir_parameter.xml +++ b/storage_media/data/ir_parameter.xml @@ -1,6 +1,6 @@ - + storage.media.backend_id From 539baa7efe58f67940fbc03c4dc18d0f35f9d28c Mon Sep 17 00:00:00 2001 From: Benoit Date: Wed, 10 Apr 2019 18:27:35 +0200 Subject: [PATCH 04/30] [FIX] clean with pre-commit and pep 8 --- storage_media/__manifest__.py | 18 +++------- storage_media/models/storage_file.py | 4 +-- storage_media/models/storage_media.py | 41 +++++++++++----------- storage_media/models/storage_media_type.py | 4 +-- 4 files changed, 30 insertions(+), 37 deletions(-) diff --git a/storage_media/__manifest__.py b/storage_media/__manifest__.py index 42c28b8e05..ff362d5aa7 100644 --- a/storage_media/__manifest__.py +++ b/storage_media/__manifest__.py @@ -12,15 +12,9 @@ "author": " Akretion", "license": "AGPL-3", "application": False, - 'installable': True, - "external_dependencies": { - "python": [], - "bin": [], - }, - "depends": [ - "storage_file", - "storage_thumbnail", - ], + "installable": True, + "external_dependencies": {"python": [], "bin": []}, + "depends": ["storage_file", "storage_thumbnail"], "data": [ "views/storage_media_view.xml", "data/ir_parameter.xml", @@ -28,8 +22,6 @@ "security/ir_rule.xml", "security/ir.model.access.csv", ], - "demo": [ - ], - "qweb": [ - ] + "demo": [], + "qweb": [], } diff --git a/storage_media/models/storage_file.py b/storage_media/models/storage_file.py index 1ad8e2db0e..ee074272bd 100644 --- a/storage_media/models/storage_file.py +++ b/storage_media/models/storage_file.py @@ -7,6 +7,6 @@ class StorageFile(models.Model): - _inherit = 'storage.file' + _inherit = "storage.file" - file_type = fields.Selection(selection_add=[('media', 'Media')]) + file_type = fields.Selection(selection_add=[("media", "Media")]) diff --git a/storage_media/models/storage_media.py b/storage_media/models/storage_media.py index ecb534e0a8..eb992e2336 100644 --- a/storage_media/models/storage_media.py +++ b/storage_media/models/storage_media.py @@ -3,43 +3,41 @@ # @author Sébastien BEAU # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +import logging import os + from odoo import api, fields, models -import logging + _logger = logging.getLogger(__name__) try: from slugify import slugify except ImportError: - _logger.debug('Cannot `import slugify`.') + _logger.debug("Cannot `import slugify`.") class StorageMedia(models.Model): - _name = 'storage.media' - _description = 'Storage Media' - _inherits = {'storage.file': 'file_id'} + _name = "storage.media" + _description = "Storage Media" + _inherits = {"storage.file": "file_id"} file_id = fields.Many2one( - 'storage.file', - 'File', - required=True, - ondelete='cascade') - media_type_id = fields.Many2one( - 'storage.media.type', - 'Media Type') - - @api.onchange('name') + "storage.file", "File", required=True, ondelete="cascade" + ) + media_type_id = fields.Many2one("storage.media.type", "Media Type") + + @api.onchange("name") def onchange_name(self): for record in self: if record.name: filename, extension = os.path.splitext(record.name) - record.name = "%s%s" % (slugify(filename), extension) + record.name = "{}{}".format(slugify(filename), extension) @api.model def create(self, vals): - vals['file_type'] = 'media' - if 'backend_id' not in vals: - vals['backend_id'] = self._get_backend_id() + vals["file_type"] = "media" + if "backend_id" not in vals: + vals["backend_id"] = self._get_backend_id() return super(StorageMedia, self).create(vals) def _get_backend_id(self): @@ -48,5 +46,8 @@ def _get_backend_id(self): By default : it's the one configured as ir.config_parameter Overload this method if you need something more powerfull """ - return int(self.env['ir.config_parameter'].get_param( - 'storage.media.backend_id')) + return int( + self.env["ir.config_parameter"].get_param( + "storage.media.backend_id" + ) + ) diff --git a/storage_media/models/storage_media_type.py b/storage_media/models/storage_media_type.py index 582e03d9db..8b4f5f5d18 100644 --- a/storage_media/models/storage_media_type.py +++ b/storage_media/models/storage_media_type.py @@ -7,8 +7,8 @@ class MediaType(models.Model): - _name = 'storage.media.type' - _description = 'Storage Media Type' + _name = "storage.media.type" + _description = "Storage Media Type" name = fields.Char(translated=True, required=True) code = fields.Char() From e8c7e2e2636021e025fc1ab150b268e900f44338 Mon Sep 17 00:00:00 2001 From: Benoit Date: Fri, 12 Apr 2019 15:57:40 +0200 Subject: [PATCH 05/30] [IMP] add tests and support pilbox for thumbnail --- storage_media/models/storage_media.py | 2 +- storage_media/tests/__init__.py | 3 +++ storage_media/tests/test_storage_media.py | 28 +++++++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 storage_media/tests/__init__.py create mode 100644 storage_media/tests/test_storage_media.py diff --git a/storage_media/models/storage_media.py b/storage_media/models/storage_media.py index eb992e2336..c71ac350c0 100644 --- a/storage_media/models/storage_media.py +++ b/storage_media/models/storage_media.py @@ -12,7 +12,7 @@ try: from slugify import slugify -except ImportError: +except ImportError: # pragma: no cover _logger.debug("Cannot `import slugify`.") diff --git a/storage_media/tests/__init__.py b/storage_media/tests/__init__.py new file mode 100644 index 0000000000..7fd53a9ed6 --- /dev/null +++ b/storage_media/tests/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import test_storage_media diff --git a/storage_media/tests/test_storage_media.py b/storage_media/tests/test_storage_media.py new file mode 100644 index 0000000000..cd42548bca --- /dev/null +++ b/storage_media/tests/test_storage_media.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Akretion (http://www.akretion.com). +# @author Sébastien BEAU +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.addons.component.tests.common import TransactionComponentCase + + +class StorageMediaCase(TransactionComponentCase): + def setUp(self): + super(StorageMediaCase, self).setUp() + self.filename = "test of my_file.txt" + + def test_onchange_name(self): + media = self.env["storage.media"].create( + {"name": self.filename, "backend_id": self.backend_id} + ) + self.assetEqual(media.name, self.filename) + new_filename = "new file_name.txt" + media.name = new_filename + media._onchange_name() + values = media._convert_to_write(media._cache) + self.assertEqual(values["name"], "new-file-name.txt") + + def test_create_media(self): + media = self.env["storage.media"].create({"name": self.filename}) + self.assertEqual(media.file_type, "media") + self.assertIsNotNone(media.backend_id) From 19db2a1d3fb52833abf40ee7e63d403529d27da6 Mon Sep 17 00:00:00 2001 From: Benoit Date: Fri, 12 Apr 2019 18:50:42 +0200 Subject: [PATCH 06/30] [IMP] tests --- storage_media/tests/test_storage_media.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/storage_media/tests/test_storage_media.py b/storage_media/tests/test_storage_media.py index cd42548bca..000b8bbd1d 100644 --- a/storage_media/tests/test_storage_media.py +++ b/storage_media/tests/test_storage_media.py @@ -9,16 +9,17 @@ class StorageMediaCase(TransactionComponentCase): def setUp(self): super(StorageMediaCase, self).setUp() + self.backend = self.env.ref("storage_backend.default_storage_backend") self.filename = "test of my_file.txt" def test_onchange_name(self): media = self.env["storage.media"].create( - {"name": self.filename, "backend_id": self.backend_id} + {"name": self.filename, "backend_id": self.backend.id} ) - self.assetEqual(media.name, self.filename) - new_filename = "new file_name.txt" + self.assertEqual(media.name, self.filename) + new_filename = "new file name.txt" media.name = new_filename - media._onchange_name() + media.onchange_name() values = media._convert_to_write(media._cache) self.assertEqual(values["name"], "new-file-name.txt") From 2f74d3573ba63fdf77bda05e319fc48a6dd6af9c Mon Sep 17 00:00:00 2001 From: Denis Roussel Date: Fri, 7 Jun 2019 11:55:47 +0200 Subject: [PATCH 07/30] [12.0] storage*: Make installable False --- storage_media/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage_media/__manifest__.py b/storage_media/__manifest__.py index ff362d5aa7..0d2e411426 100644 --- a/storage_media/__manifest__.py +++ b/storage_media/__manifest__.py @@ -12,7 +12,7 @@ "author": " Akretion", "license": "AGPL-3", "application": False, - "installable": True, + "installable": False, "external_dependencies": {"python": [], "bin": []}, "depends": ["storage_file", "storage_thumbnail"], "data": [ From 32d2a6aecd49c91436cce1ca98dc36b83bf308e9 Mon Sep 17 00:00:00 2001 From: Simone Orsi Date: Thu, 5 Sep 2019 15:22:30 +0200 Subject: [PATCH 08/30] Storage: admin user can manage too --- storage_media/security/res_group.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage_media/security/res_group.xml b/storage_media/security/res_group.xml index 984de2a83c..6f24f34336 100644 --- a/storage_media/security/res_group.xml +++ b/storage_media/security/res_group.xml @@ -3,7 +3,7 @@ Storage Media Manager - + From 8650db4eec9f460a6ef94280c4b1006d3f1851cd Mon Sep 17 00:00:00 2001 From: "Laurent Mignon (ACSONE)" Date: Tue, 24 Sep 2019 10:44:11 +0200 Subject: [PATCH 09/30] [FIX] __manifest__: Uses github repo url as website and add OCA into author fixes #1 --- storage_media/__manifest__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/storage_media/__manifest__.py b/storage_media/__manifest__.py index 0d2e411426..0fc8bc8e19 100644 --- a/storage_media/__manifest__.py +++ b/storage_media/__manifest__.py @@ -8,8 +8,8 @@ "summary": "Give the posibility to store media data in Odoo", "version": "10.0.1.0.0", "category": "Uncategorized", - "website": "www.akretion.com", - "author": " Akretion", + "website": "https://www.github.com/OCA/storage", + "author": " Akretion, Odoo Community Association (OCA)", "license": "AGPL-3", "application": False, "installable": False, From 7953faeb56765d657b89f9d43fa736fa4f3d10b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul=20=28ACSONE=29?= Date: Tue, 1 Oct 2019 22:35:35 +0200 Subject: [PATCH 10/30] pre-commit, black, isort --- storage_media/models/storage_media.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/storage_media/models/storage_media.py b/storage_media/models/storage_media.py index c71ac350c0..a9db9de22f 100644 --- a/storage_media/models/storage_media.py +++ b/storage_media/models/storage_media.py @@ -21,9 +21,7 @@ class StorageMedia(models.Model): _description = "Storage Media" _inherits = {"storage.file": "file_id"} - file_id = fields.Many2one( - "storage.file", "File", required=True, ondelete="cascade" - ) + file_id = fields.Many2one("storage.file", "File", required=True, ondelete="cascade") media_type_id = fields.Many2one("storage.media.type", "Media Type") @api.onchange("name") @@ -47,7 +45,5 @@ def _get_backend_id(self): Overload this method if you need something more powerfull """ return int( - self.env["ir.config_parameter"].get_param( - "storage.media.backend_id" - ) + self.env["ir.config_parameter"].get_param("storage.media.backend_id") ) From 85acf28979d391676cf7808ead3c8252d950ac8c Mon Sep 17 00:00:00 2001 From: Simone Orsi Date: Fri, 22 Nov 2019 18:31:41 +0100 Subject: [PATCH 11/30] Add server_env support --- storage_media/models/storage_media.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/storage_media/models/storage_media.py b/storage_media/models/storage_media.py index a9db9de22f..55abb4be42 100644 --- a/storage_media/models/storage_media.py +++ b/storage_media/models/storage_media.py @@ -20,6 +20,7 @@ class StorageMedia(models.Model): _name = "storage.media" _description = "Storage Media" _inherits = {"storage.file": "file_id"} + _default_file_type = "media" file_id = fields.Many2one("storage.file", "File", required=True, ondelete="cascade") media_type_id = fields.Many2one("storage.media.type", "Media Type") @@ -33,17 +34,12 @@ def onchange_name(self): @api.model def create(self, vals): - vals["file_type"] = "media" + vals["file_type"] = self._default_file_type if "backend_id" not in vals: - vals["backend_id"] = self._get_backend_id() + vals["backend_id"] = self._get_default_backend_id() return super(StorageMedia, self).create(vals) - def _get_backend_id(self): - """Choose the correct backend. - - By default : it's the one configured as ir.config_parameter - Overload this method if you need something more powerfull - """ - return int( - self.env["ir.config_parameter"].get_param("storage.media.backend_id") - ) + def _get_default_backend_id(self): + return self.env["storage.backend"]._get_backend_id_from_param( + self.env, "storage.media.backend_id" + ) \ No newline at end of file From e260b931b7c0f81117af0b6e35f8325d4f30f152 Mon Sep 17 00:00:00 2001 From: Simone Orsi Date: Wed, 12 Aug 2020 08:59:03 +0200 Subject: [PATCH 12/30] [REF] storage_media: Black python code --- storage_media/models/storage_media.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/storage_media/models/storage_media.py b/storage_media/models/storage_media.py index 55abb4be42..a5ed1e0ab7 100644 --- a/storage_media/models/storage_media.py +++ b/storage_media/models/storage_media.py @@ -22,7 +22,9 @@ class StorageMedia(models.Model): _inherits = {"storage.file": "file_id"} _default_file_type = "media" - file_id = fields.Many2one("storage.file", "File", required=True, ondelete="cascade") + file_id = fields.Many2one( + "storage.file", "File", required=True, ondelete="cascade" + ) media_type_id = fields.Many2one("storage.media.type", "Media Type") @api.onchange("name") @@ -42,4 +44,4 @@ def create(self, vals): def _get_default_backend_id(self): return self.env["storage.backend"]._get_backend_id_from_param( self.env, "storage.media.backend_id" - ) \ No newline at end of file + ) From 86e00740d2cc93b733eeee5440df9a97634505f5 Mon Sep 17 00:00:00 2001 From: Simone Orsi Date: Wed, 12 Aug 2020 08:59:04 +0200 Subject: [PATCH 13/30] [MIG] storage_media: Migration to 13.0 --- storage_media/__init__.py | 2 -- storage_media/__manifest__.py | 5 ++--- storage_media/data/ir_parameter.xml | 6 ++---- storage_media/models/__init__.py | 2 -- storage_media/models/storage_file.py | 1 - storage_media/models/storage_media.py | 1 - storage_media/models/storage_media_type.py | 1 - storage_media/tests/__init__.py | 2 -- storage_media/tests/test_storage_media.py | 1 - storage_media/views/storage_media_view.xml | 2 -- 10 files changed, 4 insertions(+), 19 deletions(-) diff --git a/storage_media/__init__.py b/storage_media/__init__.py index cde864bae2..0650744f6b 100644 --- a/storage_media/__init__.py +++ b/storage_media/__init__.py @@ -1,3 +1 @@ -# -*- coding: utf-8 -*- - from . import models diff --git a/storage_media/__manifest__.py b/storage_media/__manifest__.py index 0fc8bc8e19..54bca764b2 100644 --- a/storage_media/__manifest__.py +++ b/storage_media/__manifest__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2017 Akretion (http://www.akretion.com). # @author Sébastien BEAU # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). @@ -6,13 +5,13 @@ { "name": "Storage Media", "summary": "Give the posibility to store media data in Odoo", - "version": "10.0.1.0.0", + "version": "13.0.1.0.0", "category": "Uncategorized", "website": "https://www.github.com/OCA/storage", "author": " Akretion, Odoo Community Association (OCA)", "license": "AGPL-3", "application": False, - "installable": False, + "installable": True, "external_dependencies": {"python": [], "bin": []}, "depends": ["storage_file", "storage_thumbnail"], "data": [ diff --git a/storage_media/data/ir_parameter.xml b/storage_media/data/ir_parameter.xml index 8f32b42299..c4f3b9a8e5 100644 --- a/storage_media/data/ir_parameter.xml +++ b/storage_media/data/ir_parameter.xml @@ -1,11 +1,9 @@ - - + storage.media.backend_id - - + diff --git a/storage_media/models/__init__.py b/storage_media/models/__init__.py index a74dc3b476..d2bf407514 100644 --- a/storage_media/models/__init__.py +++ b/storage_media/models/__init__.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - from . import storage_file from . import storage_media from . import storage_media_type diff --git a/storage_media/models/storage_file.py b/storage_media/models/storage_file.py index ee074272bd..381549baec 100644 --- a/storage_media/models/storage_file.py +++ b/storage_media/models/storage_file.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2017 Akretion (http://www.akretion.com). # @author Sébastien BEAU # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/storage_media/models/storage_media.py b/storage_media/models/storage_media.py index a5ed1e0ab7..4f08a574ec 100644 --- a/storage_media/models/storage_media.py +++ b/storage_media/models/storage_media.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2017 Akretion (http://www.akretion.com). # @author Sébastien BEAU # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/storage_media/models/storage_media_type.py b/storage_media/models/storage_media_type.py index 8b4f5f5d18..bf7d84f12e 100644 --- a/storage_media/models/storage_media_type.py +++ b/storage_media/models/storage_media_type.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2017 Akretion (http://www.akretion.com). # @author Sébastien BEAU # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/storage_media/tests/__init__.py b/storage_media/tests/__init__.py index 7fd53a9ed6..4a12853692 100644 --- a/storage_media/tests/__init__.py +++ b/storage_media/tests/__init__.py @@ -1,3 +1 @@ -# -*- coding: utf-8 -*- - from . import test_storage_media diff --git a/storage_media/tests/test_storage_media.py b/storage_media/tests/test_storage_media.py index 000b8bbd1d..d24cc228b1 100644 --- a/storage_media/tests/test_storage_media.py +++ b/storage_media/tests/test_storage_media.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2017 Akretion (http://www.akretion.com). # @author Sébastien BEAU # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/storage_media/views/storage_media_view.xml b/storage_media/views/storage_media_view.xml index a17813eada..a915cc9e27 100644 --- a/storage_media/views/storage_media_view.xml +++ b/storage_media/views/storage_media_view.xml @@ -67,7 +67,6 @@ Storage Media Type ir.actions.act_window storage.media.type - form tree,form [] @@ -96,7 +95,6 @@ Storage Media storage.media - form tree,form From 7e5994b25570490278d009a3a10fa6c7e16cc480 Mon Sep 17 00:00:00 2001 From: Simone Orsi Date: Wed, 12 Aug 2020 12:59:47 +0200 Subject: [PATCH 14/30] storage_media: allow create type from form --- storage_media/views/storage_media_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage_media/views/storage_media_view.xml b/storage_media/views/storage_media_view.xml index a915cc9e27..92126ce15f 100644 --- a/storage_media/views/storage_media_view.xml +++ b/storage_media/views/storage_media_view.xml @@ -25,7 +25,7 @@ attrs="{'invisible': [('id', '=', False)]}" widget="url"/> - + From f22d8b899ed578fbd82d5ffe233d8c92daae92aa Mon Sep 17 00:00:00 2001 From: oca-travis Date: Fri, 28 Aug 2020 14:06:07 +0000 Subject: [PATCH 15/30] [UPD] Update storage_media.pot --- storage_media/i18n/storage_media.pot | 199 +++++++++++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100644 storage_media/i18n/storage_media.pot diff --git a/storage_media/i18n/storage_media.pot b/storage_media/i18n/storage_media.pot new file mode 100644 index 0000000000..e3c4429d10 --- /dev/null +++ b/storage_media/i18n/storage_media.pot @@ -0,0 +1,199 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * storage_media +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: storage_media +#: model:ir.model.fields,field_description:storage_media.field_storage_media__active +msgid "Active" +msgstr "" + +#. module: storage_media +#: model:ir.model.fields,field_description:storage_media.field_storage_media__checksum +msgid "Checksum/SHA1" +msgstr "" + +#. module: storage_media +#: model:ir.model.fields,field_description:storage_media.field_storage_media_type__code +msgid "Code" +msgstr "" + +#. module: storage_media +#: model:ir.model.fields,field_description:storage_media.field_storage_media__company_id +msgid "Company" +msgstr "" + +#. module: storage_media +#: model:ir.model.fields,field_description:storage_media.field_storage_media__create_uid +#: model:ir.model.fields,field_description:storage_media.field_storage_media_type__create_uid +msgid "Created by" +msgstr "" + +#. module: storage_media +#: model:ir.model.fields,field_description:storage_media.field_storage_media__create_date +#: model:ir.model.fields,field_description:storage_media.field_storage_media_type__create_date +msgid "Created on" +msgstr "" + +#. module: storage_media +#: model:ir.model.fields,field_description:storage_media.field_storage_media__data +msgid "Data" +msgstr "" + +#. module: storage_media +#: model:ir.model.fields,help:storage_media.field_storage_media__data +msgid "Datas" +msgstr "" + +#. module: storage_media +#: model:ir.model.fields,field_description:storage_media.field_storage_media__display_name +#: model:ir.model.fields,field_description:storage_media.field_storage_media_type__display_name +msgid "Display Name" +msgstr "" + +#. module: storage_media +#: model:ir.model.fields,field_description:storage_media.field_storage_media__extension +msgid "Extension" +msgstr "" + +#. module: storage_media +#: model:ir.model.fields,field_description:storage_media.field_storage_media__file_id +msgid "File" +msgstr "" + +#. module: storage_media +#: model:ir.model.fields,field_description:storage_media.field_storage_media__file_size +msgid "File Size" +msgstr "" + +#. module: storage_media +#: model:ir.model.fields,field_description:storage_media.field_storage_file__file_type +#: model:ir.model.fields,field_description:storage_media.field_storage_image__file_type +#: model:ir.model.fields,field_description:storage_media.field_storage_media__file_type +#: model:ir.model.fields,field_description:storage_media.field_storage_thumbnail__file_type +msgid "File Type" +msgstr "" + +#. module: storage_media +#: model:ir.model.fields,field_description:storage_media.field_storage_media__filename +msgid "Filename without extension" +msgstr "" + +#. module: storage_media +#: model:ir.model.fields,help:storage_media.field_storage_media__url +msgid "HTTP accessible path to the file" +msgstr "" + +#. module: storage_media +#: model:ir.model.fields,field_description:storage_media.field_storage_media__human_file_size +msgid "Human File Size" +msgstr "" + +#. module: storage_media +#: model:ir.model.fields,field_description:storage_media.field_storage_media__id +#: model:ir.model.fields,field_description:storage_media.field_storage_media_type__id +msgid "ID" +msgstr "" + +#. module: storage_media +#: model:ir.model.fields,field_description:storage_media.field_storage_media____last_update +#: model:ir.model.fields,field_description:storage_media.field_storage_media_type____last_update +msgid "Last Modified on" +msgstr "" + +#. module: storage_media +#: model:ir.model.fields,field_description:storage_media.field_storage_media__write_uid +#: model:ir.model.fields,field_description:storage_media.field_storage_media_type__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: storage_media +#: model:ir.model.fields,field_description:storage_media.field_storage_media__write_date +#: model:ir.model.fields,field_description:storage_media.field_storage_media_type__write_date +msgid "Last Updated on" +msgstr "" + +#. module: storage_media +#: model:ir.model.fields.selection,name:storage_media.selection__storage_file__file_type__media +msgid "Media" +msgstr "" + +#. module: storage_media +#: model:ir.model.fields,field_description:storage_media.field_storage_media__media_type_id +msgid "Media Type" +msgstr "" + +#. module: storage_media +#: model:ir.model.fields,field_description:storage_media.field_storage_media__mimetype +msgid "Mime Type" +msgstr "" + +#. module: storage_media +#: model:ir.model.fields,field_description:storage_media.field_storage_media__name +#: model:ir.model.fields,field_description:storage_media.field_storage_media_type__name +msgid "Name" +msgstr "" + +#. module: storage_media +#: model:ir.model.fields,field_description:storage_media.field_storage_media__relative_path +msgid "Relative Path" +msgstr "" + +#. module: storage_media +#: model:ir.model.fields,help:storage_media.field_storage_media__relative_path +msgid "Relative location for backend" +msgstr "" + +#. module: storage_media +#: model:ir.model.fields,field_description:storage_media.field_storage_media__backend_id +msgid "Storage" +msgstr "" + +#. module: storage_media +#: model:ir.model,name:storage_media.model_storage_file +msgid "Storage File" +msgstr "" + +#. module: storage_media +#: model:ir.actions.act_window,name:storage_media.storage_media_action +#: model:ir.model,name:storage_media.model_storage_media +#: model:ir.ui.menu,name:storage_media.storage_media_menu +#: model_terms:ir.ui.view,arch_db:storage_media.storage_media_view_form +#: model_terms:ir.ui.view,arch_db:storage_media.storage_media_view_tree +msgid "Storage Media" +msgstr "" + +#. module: storage_media +#: model:res.groups,name:storage_media.group_media_manager +msgid "Storage Media Manager" +msgstr "" + +#. module: storage_media +#: model:ir.actions.act_window,name:storage_media.act_open_storage_media_type_view +#: model:ir.model,name:storage_media.model_storage_media_type +#: model:ir.ui.menu,name:storage_media.menu_storage_media_type +#: model_terms:ir.ui.view,arch_db:storage_media.storage_media_type_view_form +#: model_terms:ir.ui.view,arch_db:storage_media.storage_media_type_view_search +#: model_terms:ir.ui.view,arch_db:storage_media.storage_media_type_view_tree +msgid "Storage Media Type" +msgstr "" + +#. module: storage_media +#: model:ir.model.fields,field_description:storage_media.field_storage_media__to_delete +msgid "To Delete" +msgstr "" + +#. module: storage_media +#: model:ir.model.fields,field_description:storage_media.field_storage_media__url +msgid "Url" +msgstr "" From 1b4944e20fc2f27421de5d5b6acd3ead7c7664f2 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Fri, 28 Aug 2020 14:12:54 +0000 Subject: [PATCH 16/30] [ADD] icon.png --- storage_media/static/description/icon.png | Bin 0 -> 9455 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 storage_media/static/description/icon.png diff --git a/storage_media/static/description/icon.png b/storage_media/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d GIT binary patch literal 9455 zcmW++2RxMjAAjx~&dlBk9S+%}OXg)AGE&Cb*&}d0jUxM@u(PQx^-s)697TX`eh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ot~6%7mLt5t8Vwi^Jy7|jWXqa3amOIoRb zOr}WVFP--DsS`1WpN%~)t3R!arKF^Q$e12KEqU36AWwnCBICpH4XCsfnyrHr>$I$4 z!DpKX$OKLWarN7nv@!uIA+~RNO)l$$w}p(;b>mx8pwYvu;dD_unryX_NhT8*Tj>BTrTTL&!?O+%Rv;b?B??gSzdp?6Uug9{ zd@V08Z$BdI?fpoCS$)t4mg4rT8Q_I}h`0d-vYZ^|dOB*Q^S|xqTV*vIg?@fVFSmMpaw0qtTRbx} z({Pg?#{2`sc9)M5N$*N|4;^t$+QP?#mov zGVC@I*lBVrOU-%2y!7%)fAKjpEFsgQc4{amtiHb95KQEwvf<(3T<9-Zm$xIew#P22 zc2Ix|App^>v6(3L_MCU0d3W##AB0M~3D00EWoKZqsJYT(#@w$Y_H7G22M~ApVFTRHMI_3be)Lkn#0F*V8Pq zc}`Cjy$bE;FJ6H7p=0y#R>`}-m4(0F>%@P|?7fx{=R^uFdISRnZ2W_xQhD{YuR3t< z{6yxu=4~JkeA;|(J6_nv#>Nvs&FuLA&PW^he@t(UwFFE8)|a!R{`E`K`i^ZnyE4$k z;(749Ix|oi$c3QbEJ3b~D_kQsPz~fIUKym($a_7dJ?o+40*OLl^{=&oq$<#Q(yyrp z{J-FAniyAw9tPbe&IhQ|a`DqFTVQGQ&Gq3!C2==4x{6EJwiPZ8zub-iXoUtkJiG{} zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N Xviia!U7SGha1wx#SCgwmn*{w2TRX*I literal 0 HcmV?d00001 From 5cdaef0d5b283b92b34f617e79b1cb3f94e5810a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20BEAU?= Date: Sun, 6 Dec 2020 09:53:40 +0100 Subject: [PATCH 17/30] [ADD] add new V14 config --- storage_media/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage_media/__manifest__.py b/storage_media/__manifest__.py index 54bca764b2..cbfe525079 100644 --- a/storage_media/__manifest__.py +++ b/storage_media/__manifest__.py @@ -11,7 +11,7 @@ "author": " Akretion, Odoo Community Association (OCA)", "license": "AGPL-3", "application": False, - "installable": True, + "installable": False, "external_dependencies": {"python": [], "bin": []}, "depends": ["storage_file", "storage_thumbnail"], "data": [ From 4e5f85be2228f8244a43f9829763192960b3548f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20BEAU?= Date: Sun, 6 Dec 2020 10:10:22 +0100 Subject: [PATCH 18/30] [IMP] all: black, isort, prettier --- storage_media/__manifest__.py | 4 +- storage_media/data/ir_parameter.xml | 4 +- storage_media/models/storage_media.py | 4 +- storage_media/security/ir_rule.xml | 6 +- storage_media/security/res_group.xml | 7 +- storage_media/views/storage_media_view.xml | 76 ++++++++++++---------- 6 files changed, 55 insertions(+), 46 deletions(-) diff --git a/storage_media/__manifest__.py b/storage_media/__manifest__.py index cbfe525079..47c26cad72 100644 --- a/storage_media/__manifest__.py +++ b/storage_media/__manifest__.py @@ -7,11 +7,11 @@ "summary": "Give the posibility to store media data in Odoo", "version": "13.0.1.0.0", "category": "Uncategorized", - "website": "https://www.github.com/OCA/storage", + "website": "https://github.com/OCA/storage", "author": " Akretion, Odoo Community Association (OCA)", "license": "AGPL-3", "application": False, - "installable": False, + "installable": True, "external_dependencies": {"python": [], "bin": []}, "depends": ["storage_file", "storage_thumbnail"], "data": [ diff --git a/storage_media/data/ir_parameter.xml b/storage_media/data/ir_parameter.xml index c4f3b9a8e5..0cccb2e7e9 100644 --- a/storage_media/data/ir_parameter.xml +++ b/storage_media/data/ir_parameter.xml @@ -1,9 +1,9 @@ - + storage.media.backend_id - + diff --git a/storage_media/models/storage_media.py b/storage_media/models/storage_media.py index 4f08a574ec..7b4077da82 100644 --- a/storage_media/models/storage_media.py +++ b/storage_media/models/storage_media.py @@ -21,9 +21,7 @@ class StorageMedia(models.Model): _inherits = {"storage.file": "file_id"} _default_file_type = "media" - file_id = fields.Many2one( - "storage.file", "File", required=True, ondelete="cascade" - ) + file_id = fields.Many2one("storage.file", "File", required=True, ondelete="cascade") media_type_id = fields.Many2one("storage.media.type", "Media Type") @api.onchange("name") diff --git a/storage_media/security/ir_rule.xml b/storage_media/security/ir_rule.xml index 50f2f7e063..f4c337d87a 100644 --- a/storage_media/security/ir_rule.xml +++ b/storage_media/security/ir_rule.xml @@ -1,11 +1,11 @@ - + Storage File for Media - + [('file_type','=', 'media')] - + diff --git a/storage_media/security/res_group.xml b/storage_media/security/res_group.xml index 6f24f34336..0973e4d56f 100644 --- a/storage_media/security/res_group.xml +++ b/storage_media/security/res_group.xml @@ -1,9 +1,12 @@ - + Storage Media Manager - + diff --git a/storage_media/views/storage_media_view.xml b/storage_media/views/storage_media_view.xml index 92126ce15f..9a34e71d63 100644 --- a/storage_media/views/storage_media_view.xml +++ b/storage_media/views/storage_media_view.xml @@ -1,12 +1,12 @@ - + storage.media - - + + @@ -16,16 +16,20 @@
- - - - - + + + + +
@@ -35,8 +39,8 @@ storage.media.type - - + +
@@ -46,8 +50,8 @@
- - + +
@@ -57,8 +61,8 @@ storage.media.type - - + + @@ -68,29 +72,31 @@ ir.actions.act_window storage.media.type tree,form - + [] {} - - + + form - + - - + + tree - + - + Storage Media @@ -98,9 +104,11 @@ tree,form - + From 63957a67c2fa06f811a71301e2048b43a55d272c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20BEAU?= Date: Sun, 6 Dec 2020 10:17:45 +0100 Subject: [PATCH 19/30] [MIG] batch migration of modules --- storage_media/__manifest__.py | 2 +- storage_media/models/storage_file.py | 4 +++- storage_media/models/storage_media_type.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/storage_media/__manifest__.py b/storage_media/__manifest__.py index 47c26cad72..cd9ee1760a 100644 --- a/storage_media/__manifest__.py +++ b/storage_media/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Storage Media", "summary": "Give the posibility to store media data in Odoo", - "version": "13.0.1.0.0", + "version": "14.0.1.0.0", "category": "Uncategorized", "website": "https://github.com/OCA/storage", "author": " Akretion, Odoo Community Association (OCA)", diff --git a/storage_media/models/storage_file.py b/storage_media/models/storage_file.py index 381549baec..14c50cf000 100644 --- a/storage_media/models/storage_file.py +++ b/storage_media/models/storage_file.py @@ -8,4 +8,6 @@ class StorageFile(models.Model): _inherit = "storage.file" - file_type = fields.Selection(selection_add=[("media", "Media")]) + file_type = fields.Selection( + selection_add=[("media", "Media")], ondelete={"media": "set null"} + ) diff --git a/storage_media/models/storage_media_type.py b/storage_media/models/storage_media_type.py index bf7d84f12e..afb7082cfb 100644 --- a/storage_media/models/storage_media_type.py +++ b/storage_media/models/storage_media_type.py @@ -9,5 +9,5 @@ class MediaType(models.Model): _name = "storage.media.type" _description = "Storage Media Type" - name = fields.Char(translated=True, required=True) + name = fields.Char(translate=True, required=True) code = fields.Char() From 864060bd906987da9b7372d4d6050dfc123cd55c Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Mon, 1 Mar 2021 12:20:16 +0000 Subject: [PATCH 20/30] storage_media 14.0.1.0.1 --- storage_media/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage_media/__manifest__.py b/storage_media/__manifest__.py index cd9ee1760a..2233ee776a 100644 --- a/storage_media/__manifest__.py +++ b/storage_media/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Storage Media", "summary": "Give the posibility to store media data in Odoo", - "version": "14.0.1.0.0", + "version": "14.0.1.0.1", "category": "Uncategorized", "website": "https://github.com/OCA/storage", "author": " Akretion, Odoo Community Association (OCA)", From 99dec2ba62975298b071b24bff0308f2a2c74ad1 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Wed, 9 Jun 2021 19:07:14 +0000 Subject: [PATCH 21/30] [UPD] Update storage_media.pot --- storage_media/i18n/storage_media.pot | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/storage_media/i18n/storage_media.pot b/storage_media/i18n/storage_media.pot index e3c4429d10..a737911349 100644 --- a/storage_media/i18n/storage_media.pot +++ b/storage_media/i18n/storage_media.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 13.0\n" +"Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" @@ -56,6 +56,7 @@ msgid "Datas" msgstr "" #. module: storage_media +#: model:ir.model.fields,field_description:storage_media.field_storage_file__display_name #: model:ir.model.fields,field_description:storage_media.field_storage_media__display_name #: model:ir.model.fields,field_description:storage_media.field_storage_media_type__display_name msgid "Display Name" @@ -100,12 +101,14 @@ msgid "Human File Size" msgstr "" #. module: storage_media +#: model:ir.model.fields,field_description:storage_media.field_storage_file__id #: model:ir.model.fields,field_description:storage_media.field_storage_media__id #: model:ir.model.fields,field_description:storage_media.field_storage_media_type__id msgid "ID" msgstr "" #. module: storage_media +#: model:ir.model.fields,field_description:storage_media.field_storage_file____last_update #: model:ir.model.fields,field_description:storage_media.field_storage_media____last_update #: model:ir.model.fields,field_description:storage_media.field_storage_media_type____last_update msgid "Last Modified on" From 677a2e3b96b63f169b2da9943be99fd736cc6570 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Mon, 2 Aug 2021 16:44:46 +0000 Subject: [PATCH 22/30] [UPD] Update storage_media.pot --- storage_media/i18n/storage_media.pot | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/storage_media/i18n/storage_media.pot b/storage_media/i18n/storage_media.pot index a737911349..f95a8e29d2 100644 --- a/storage_media/i18n/storage_media.pot +++ b/storage_media/i18n/storage_media.pot @@ -157,6 +157,16 @@ msgstr "" msgid "Relative location for backend" msgstr "" +#. module: storage_media +#: model:ir.model.fields,field_description:storage_media.field_storage_media__slug +msgid "Slug" +msgstr "" + +#. module: storage_media +#: model:ir.model.fields,help:storage_media.field_storage_media__slug +msgid "Slug-ified name with ID for URL" +msgstr "" + #. module: storage_media #: model:ir.model.fields,field_description:storage_media.field_storage_media__backend_id msgid "Storage" From d32236c876ed0bba0c260bd8c2c3c1a137a51896 Mon Sep 17 00:00:00 2001 From: Enric Tobella Date: Wed, 10 Mar 2021 15:36:45 +0100 Subject: [PATCH 23/30] [CHG] storage: Use more permissive licence: AGPL-> LGPL --- storage_media/README.rst | 6 +++--- storage_media/__manifest__.py | 4 ++-- storage_media/models/storage_file.py | 2 +- storage_media/models/storage_media.py | 2 +- storage_media/models/storage_media_type.py | 2 +- storage_media/tests/test_storage_media.py | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/storage_media/README.rst b/storage_media/README.rst index ee8345a5f9..f90e1e43f6 100644 --- a/storage_media/README.rst +++ b/storage_media/README.rst @@ -1,6 +1,6 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 +.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 ============== Storage Media diff --git a/storage_media/__manifest__.py b/storage_media/__manifest__.py index 2233ee776a..7bdc35bba2 100644 --- a/storage_media/__manifest__.py +++ b/storage_media/__manifest__.py @@ -1,6 +1,6 @@ # Copyright 2017 Akretion (http://www.akretion.com). # @author Sébastien BEAU -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). { "name": "Storage Media", @@ -9,7 +9,7 @@ "category": "Uncategorized", "website": "https://github.com/OCA/storage", "author": " Akretion, Odoo Community Association (OCA)", - "license": "AGPL-3", + "license": "LGPL-3", "application": False, "installable": True, "external_dependencies": {"python": [], "bin": []}, diff --git a/storage_media/models/storage_file.py b/storage_media/models/storage_file.py index 14c50cf000..9874b0331b 100644 --- a/storage_media/models/storage_file.py +++ b/storage_media/models/storage_file.py @@ -1,6 +1,6 @@ # Copyright 2017 Akretion (http://www.akretion.com). # @author Sébastien BEAU -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). from odoo import fields, models diff --git a/storage_media/models/storage_media.py b/storage_media/models/storage_media.py index 7b4077da82..4a5e6a9972 100644 --- a/storage_media/models/storage_media.py +++ b/storage_media/models/storage_media.py @@ -1,6 +1,6 @@ # Copyright 2017 Akretion (http://www.akretion.com). # @author Sébastien BEAU -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). import logging import os diff --git a/storage_media/models/storage_media_type.py b/storage_media/models/storage_media_type.py index afb7082cfb..10f4470502 100644 --- a/storage_media/models/storage_media_type.py +++ b/storage_media/models/storage_media_type.py @@ -1,6 +1,6 @@ # Copyright 2017 Akretion (http://www.akretion.com). # @author Sébastien BEAU -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). from odoo import fields, models diff --git a/storage_media/tests/test_storage_media.py b/storage_media/tests/test_storage_media.py index d24cc228b1..0e4a106dc8 100644 --- a/storage_media/tests/test_storage_media.py +++ b/storage_media/tests/test_storage_media.py @@ -1,6 +1,6 @@ # Copyright 2017 Akretion (http://www.akretion.com). # @author Sébastien BEAU -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). from odoo.addons.component.tests.common import TransactionComponentCase From 394416674642102ea8192029f0152feabfe62d48 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Mon, 2 Aug 2021 18:42:25 +0000 Subject: [PATCH 24/30] storage_media 14.0.2.0.0 --- storage_media/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage_media/__manifest__.py b/storage_media/__manifest__.py index 7bdc35bba2..f78008fc4e 100644 --- a/storage_media/__manifest__.py +++ b/storage_media/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Storage Media", "summary": "Give the posibility to store media data in Odoo", - "version": "14.0.1.0.1", + "version": "14.0.2.0.0", "category": "Uncategorized", "website": "https://github.com/OCA/storage", "author": " Akretion, Odoo Community Association (OCA)", From beac970b44297aa5103838a097909b28000cc781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Villarreal=20Ortega?= Date: Fri, 25 Jun 2021 10:39:07 +0200 Subject: [PATCH 25/30] storage_media: Explicit ir rule definition for Storage File for Media --- storage_media/security/ir_rule.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/storage_media/security/ir_rule.xml b/storage_media/security/ir_rule.xml index f4c337d87a..98baf117be 100644 --- a/storage_media/security/ir_rule.xml +++ b/storage_media/security/ir_rule.xml @@ -6,6 +6,10 @@ [('file_type','=', 'media')] + + + + From e431e9c12ab4fd62d9278ae80cee2712c1d23699 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Wed, 6 Oct 2021 10:23:14 +0000 Subject: [PATCH 26/30] storage_media 14.0.2.1.0 --- storage_media/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage_media/__manifest__.py b/storage_media/__manifest__.py index f78008fc4e..db7f620ac1 100644 --- a/storage_media/__manifest__.py +++ b/storage_media/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Storage Media", "summary": "Give the posibility to store media data in Odoo", - "version": "14.0.2.0.0", + "version": "14.0.2.1.0", "category": "Uncategorized", "website": "https://github.com/OCA/storage", "author": " Akretion, Odoo Community Association (OCA)", From 91546131a2c679be12abc45e5096b5449244dea1 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Fri, 27 May 2022 12:23:05 +0000 Subject: [PATCH 27/30] [UPD] Update storage_media.pot --- storage_media/i18n/storage_media.pot | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/storage_media/i18n/storage_media.pot b/storage_media/i18n/storage_media.pot index f95a8e29d2..03b4251139 100644 --- a/storage_media/i18n/storage_media.pot +++ b/storage_media/i18n/storage_media.pot @@ -90,6 +90,11 @@ msgstr "" msgid "Filename without extension" msgstr "" +#. module: storage_media +#: model:ir.model.fields,help:storage_media.field_storage_media__internal_url +msgid "HTTP URL to load the file directly from storage." +msgstr "" + #. module: storage_media #: model:ir.model.fields,help:storage_media.field_storage_media__url msgid "HTTP accessible path to the file" @@ -107,6 +112,11 @@ msgstr "" msgid "ID" msgstr "" +#. module: storage_media +#: model:ir.model.fields,field_description:storage_media.field_storage_media__internal_url +msgid "Internal Url" +msgstr "" + #. module: storage_media #: model:ir.model.fields,field_description:storage_media.field_storage_file____last_update #: model:ir.model.fields,field_description:storage_media.field_storage_media____last_update From 60db8e79e1ea8234ac82f6574609675902ede6b1 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Wed, 15 Jun 2022 18:52:11 +0000 Subject: [PATCH 28/30] [UPD] Update storage_media.pot --- storage_media/i18n/storage_media.pot | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/storage_media/i18n/storage_media.pot b/storage_media/i18n/storage_media.pot index 03b4251139..1f37260aca 100644 --- a/storage_media/i18n/storage_media.pot +++ b/storage_media/i18n/storage_media.pot @@ -13,6 +13,11 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" +#. module: storage_media +#: model:ir.model.fields,help:storage_media.field_storage_media__url_path +msgid "Accessible path, no base URL" +msgstr "" + #. module: storage_media #: model:ir.model.fields,field_description:storage_media.field_storage_media__active msgid "Active" @@ -220,3 +225,8 @@ msgstr "" #: model:ir.model.fields,field_description:storage_media.field_storage_media__url msgid "Url" msgstr "" + +#. module: storage_media +#: model:ir.model.fields,field_description:storage_media.field_storage_media__url_path +msgid "Url Path" +msgstr "" From 9377eb777c70a2641b48e671fc72b13e5bbee79c Mon Sep 17 00:00:00 2001 From: Jasmin Solanki Date: Mon, 25 Jul 2022 11:58:59 +0530 Subject: [PATCH 29/30] [IMP] storage_media: black, isort, prettier --- setup/storage_media/odoo/addons/storage_media | 1 + setup/storage_media/setup.py | 6 ++++++ 2 files changed, 7 insertions(+) create mode 120000 setup/storage_media/odoo/addons/storage_media create mode 100644 setup/storage_media/setup.py diff --git a/setup/storage_media/odoo/addons/storage_media b/setup/storage_media/odoo/addons/storage_media new file mode 120000 index 0000000000..addef57a07 --- /dev/null +++ b/setup/storage_media/odoo/addons/storage_media @@ -0,0 +1 @@ +../../../../storage_media \ No newline at end of file diff --git a/setup/storage_media/setup.py b/setup/storage_media/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/storage_media/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) From cac41404eb2d0269d55db6e98cf1044def71fc3b Mon Sep 17 00:00:00 2001 From: Jasmin Solanki Date: Mon, 25 Jul 2022 14:26:12 +0530 Subject: [PATCH 30/30] [MIG] storage_media: Migration to 15.0 --- storage_media/__manifest__.py | 2 +- storage_media/views/storage_media_view.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/storage_media/__manifest__.py b/storage_media/__manifest__.py index db7f620ac1..c835c3a520 100644 --- a/storage_media/__manifest__.py +++ b/storage_media/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Storage Media", "summary": "Give the posibility to store media data in Odoo", - "version": "14.0.2.1.0", + "version": "15.0.1.0.0", "category": "Uncategorized", "website": "https://github.com/OCA/storage", "author": " Akretion, Odoo Community Association (OCA)", diff --git a/storage_media/views/storage_media_view.xml b/storage_media/views/storage_media_view.xml index 9a34e71d63..f35f063d8e 100644 --- a/storage_media/views/storage_media_view.xml +++ b/storage_media/views/storage_media_view.xml @@ -4,7 +4,7 @@ storage.media - + @@ -38,7 +38,7 @@ storage.media.type - +