# HG changeset patch
# User Vincent Hatakeyama <vincent.hatakeyama@xcg-consulting.fr>
# Date 1644485417 -3600
#      Thu Feb 10 10:30:17 2022 +0100
# Node ID efa11618135cb44f03f02a6b7c943e75149313ca
# Parent  2f4ad63a0073059b3410055ab323777dc0c52dc7
✨ add chown option to do_tests

diff --git a/NEWS.rst b/NEWS.rst
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -9,7 +9,7 @@
 
 Better output of odoo 15 tests with run_tests shell script.
 
-Fix chown of extra directories.
+Fix chown of extra directories. Add chown option to do_tests.
 
 15.0.0
 ------
diff --git a/odoo_scripts/do_tests.py b/odoo_scripts/do_tests.py
--- a/odoo_scripts/do_tests.py
+++ b/odoo_scripts/do_tests.py
@@ -146,9 +146,15 @@
     parser_add_flake8_group(parser)
     parser_add_isort_group(parser)
     add_build_options(parser)
+    parser.add_argument(
+        "--chown",
+        help="run chown [default: %(default)s]",
+        action="store_true",
+        dest="run_chown",
+    )
     # TODO options
-    # - db host/uri (include socket)
-    # - db user for creation/remove
+    #  - db host/uri (include socket)
+    #  - db user for creation/remove
 
     nmspc = parser.parse_args(argv)
     apply(nmspc)
@@ -244,6 +250,8 @@
     if nmspc.LOAD_LANGUAGE:
         args.append("--load-language")
         args.append(nmspc.LOAD_LANGUAGE)
+    if nmspc.run_chown:
+        args.append("--chown")
     # also pass build options
     args.extend(get_build_options(nmspc))
     if recreate_db: