# HG changeset patch
# User Vincent Hatakeyama <vincent.hatakeyama@xcg-consulting.fr>
# Date 1657294173 -7200
#      Fri Jul 08 17:29:33 2022 +0200
# Node ID cf00c33b2c99e3eb62cbfb52ce1cacc147102f42
# Parent  c3b5f34c3892bc41e5370312df4f81be690d2bd5
set SENTRY_RELEASE/VERSION for the version module

diff --git a/NEWS.rst b/NEWS.rst
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -2,6 +2,11 @@
 History
 =======
 
+16.6.0
+------
+
+docker_dev_start: Set the VERSION and SENTRY_RELEASE environment variable. Useful when there is a module displaying their value.
+
 16.5.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
@@ -9,7 +9,7 @@
 import sys
 from argparse import ArgumentParser
 from configparser import ConfigParser
-from subprocess import call
+from subprocess import call, check_output
 from typing import List
 
 import dockerpty
@@ -889,6 +889,27 @@
         if odoo_type in (ODOO_8,):
             arg.append("--auto-reload")
 
+    project_version = "local"
+
+    if os.path.exists(".hg"):
+        project_version = check_output(
+            [
+                "hg",
+                "log",
+                "-r",
+                ".",
+                "-T",
+                "{latesttag}{sub('^-0-.*', '', '-{latesttagdistance}-m{node|short}')}",
+            ]
+        ).decode()
+
+    if os.path.exists(".git"):
+        project_version = check_output(["git", "describe"]).decode()
+
+    if project_version:
+        options["environment"]["SENTRY_RELEASE"] = project_version
+        options["environment"]["VERSION"] = project_version
+
     if odoo_help:
         arg.append("--help")