# HG changeset patch
# User Vincent Hatakeyama <vincent.hatakeyama@xcg-consulting.fr>
# Date 1686121262 -7200
#      Wed Jun 07 09:01:02 2023 +0200
# Node ID bbc6dd83361e752629dcd67c7239b4f6cb49a0c3
# Parent  31234ceee1633a90193553c341236311216aaede
📝 Add option to activate S3 storage for attachments

diff --git a/NEWS.rst b/NEWS.rst
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -7,6 +7,8 @@
 
 When copying python packages to build the image, use hg archive rather than rsync.
 
+docker_dev_start: Add option to activate S3 storage for attachments (requires the s3_attachment_storage module to be installed to work)
+
 20.3.1
 ------
 
diff --git a/odoo_scripts/docker_dev_start.py b/odoo_scripts/docker_dev_start.py
--- a/odoo_scripts/docker_dev_start.py
+++ b/odoo_scripts/docker_dev_start.py
@@ -54,9 +54,9 @@
 
 _logger = logging.getLogger(__name__)
 
-__version__ = "3.12.0"
+__version__ = "3.12.1"
 __date__ = "2017-08-11"
-__updated__ = "2023-04-26"
+__updated__ = "2023-05-15"
 
 
 def __parser(project_name: str) -> ArgumentParser:
@@ -413,6 +413,15 @@
         type=int,
     )
 
+    # workers options
+    parser.add_argument(
+        "--activate-s3-storage",
+        help="Activate S3 storage using the provided bucket as the main one [default: "
+        "%(default)s]",
+        default=None,
+        type=str,
+    )
+
     return parser
 
 
@@ -481,6 +490,7 @@
     # XXX should that variable be called multi_workers?
     longpolling = workers > 0
     test_tags = nmspc.test_tags
+    activate_s3_storage = nmspc.activate_s3_storage
 
     if restore_filename:
         if not database:
@@ -532,6 +542,13 @@
         "ports": {},
         "environment": {},
     }
+    if activate_s3_storage:
+        options["environment"].update(
+            {
+                "s3AttachmentStorageActivate": "true",
+                "s3AttachmentStorageServerBucket": activate_s3_storage,
+            }
+        )
     # if not longpolling:
     options["hostname"] = project_name
     # TODO detect that from configuration or force it