Browse Source

update

pull/6/head
Mathias Markl 7 years ago
parent
commit
2a923508c5
  1. 7
      muk_attachment_lobject/__init__.py
  2. 4
      muk_attachment_lobject/__manifest__.py

7
muk_attachment_lobject/__init__.py

@ -25,6 +25,13 @@ from . import models
from odoo import api, SUPERUSER_ID 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): def _uninstall_force_storage(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {}) env = api.Environment(cr, SUPERUSER_ID, {})
config = env['ir.config_parameter'].sudo() config = env['ir.config_parameter'].sudo()

4
muk_attachment_lobject/__manifest__.py

@ -29,7 +29,7 @@
objects. To enable the large object storage option change the objects. To enable the large object storage option change the
`ir_attachment.location` parameter to `lobject`. `ir_attachment.location` parameter to `lobject`.
""", """,
"version": '11.0.1.0.0',
"version": '11.0.1.0.1',
"category": 'Extra Tools', "category": 'Extra Tools',
"license": "AGPL-3", "license": "AGPL-3",
"website": "http://www.mukit.at", "website": "http://www.mukit.at",
@ -56,5 +56,7 @@
}, },
"application": False, "application": False,
"installable": True, "installable": True,
"auto_install": False,
"post_init_hook": "_install_force_storage",
"uninstall_hook": "_uninstall_force_storage", "uninstall_hook": "_uninstall_force_storage",
} }
Loading…
Cancel
Save