Browse Source

publish muk_attachment_lobject - 12.0

pull/9/head
MuK IT GmbH 6 years ago
parent
commit
b37efcabd2
  1. 19
      muk_attachment_lobject/__init__.py
  2. 4
      muk_attachment_lobject/__manifest__.py
  3. 5
      muk_attachment_lobject/doc/changelog.rst

19
muk_attachment_lobject/__init__.py

@ -17,4 +17,23 @@
#
###################################################################################
from odoo import api, SUPERUSER_ID
from odoo.tools import config
from . import models
def _install_force_storage(cr, registry):
if config.get("auto_storage_migration", False):
env = api.Environment(cr, SUPERUSER_ID, {})
params = env['ir.config_parameter'].sudo()
params.set_param('ir_attachment.location', 'lobject')
attachment = env['ir.attachment'].sudo().force_storage()
def _uninstall_force_storage(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
params = env['ir.config_parameter'].sudo()
location = params.get_param('ir_attachment.location')
if location == 'lobject':
params.set_param('ir_attachment.location', 'file')
attachment = env['ir.attachment'].sudo().force_storage()

4
muk_attachment_lobject/__manifest__.py

@ -20,7 +20,7 @@
{
"name": "MuK Large Objects Attachment",
"summary": """Large Objects Attachment Location""",
"version": '12.0.2.0.5',
"version": '12.0.2.1.0',
"category": 'Extra Tools',
"license": "AGPL-3",
"website": "http://www.mukit.at",
@ -45,4 +45,6 @@
"application": False,
"installable": True,
"auto_install": False,
"post_init_hook": "_install_force_storage",
"uninstall_hook": "_uninstall_force_storage",
}

5
muk_attachment_lobject/doc/changelog.rst

@ -1,3 +1,8 @@
`2.1.0`
-------
- Added Auto Migration
`2.0.0`
-------

Loading…
Cancel
Save