diff --git a/muk_attachment_lobject/__init__.py b/muk_attachment_lobject/__init__.py index 7d22bc2..59a8dfe 100644 --- a/muk_attachment_lobject/__init__.py +++ b/muk_attachment_lobject/__init__.py @@ -25,6 +25,13 @@ from . import models from odoo import api, SUPERUSER_ID +def _install_force_storage(cr, registry): + env = api.Environment(cr, SUPERUSER_ID, {}) + config = env['ir.config_parameter'].sudo() + config.set_param('ir_attachment.location', 'lobject') + attachment = env['ir.attachment'] + attachment.sudo().force_storage() + def _uninstall_force_storage(cr, registry): env = api.Environment(cr, SUPERUSER_ID, {}) config = env['ir.config_parameter'].sudo() diff --git a/muk_attachment_lobject/__manifest__.py b/muk_attachment_lobject/__manifest__.py index 9da4776..b13cf89 100644 --- a/muk_attachment_lobject/__manifest__.py +++ b/muk_attachment_lobject/__manifest__.py @@ -29,7 +29,7 @@ objects. To enable the large object storage option change the `ir_attachment.location` parameter to `lobject`. """, - "version": '11.0.1.0.0', + "version": '11.0.1.0.1', "category": 'Extra Tools', "license": "AGPL-3", "website": "http://www.mukit.at", @@ -56,5 +56,7 @@ }, "application": False, "installable": True, + "auto_install": False, + "post_init_hook": "_install_force_storage", "uninstall_hook": "_uninstall_force_storage", } \ No newline at end of file