mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-24 02:08:36 +00:00
[ADD] Added the attachment_azure with db operations
This commit is contained in:
committed by
Maxime Chambreuil
co-authored by
Maxime Chambreuil
parent
bf51e0a122
commit
e4e0c2dc5d
@@ -1 +1,20 @@
|
||||
# Copyright 2016-2019 Camptocamp SA
|
||||
# Copyright 2021 Open Source Integrators
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
||||
import os
|
||||
|
||||
from . import models
|
||||
from . import controllers
|
||||
|
||||
from odoo import api, SUPERUSER_ID
|
||||
|
||||
|
||||
def _post_init_hook(cr, registry):
|
||||
# create the Azure container after module installation
|
||||
if os.environ.get("AZURE_STORAGE_CONNECTION_STRING", False):
|
||||
env = api.Environment(cr, SUPERUSER_ID, {})
|
||||
env["ir.attachment"]._get_azure_container()
|
||||
env["ir.config_parameter"].create(
|
||||
{"key": "ir_attachment.location", "value": "azure"}
|
||||
)
|
||||
env["ir.attachment"].force_storage()
|
||||
|
||||
Reference in New Issue
Block a user