# HG changeset patch
# User Vincent Hatakeyama <vincent.hatakeyama@xcg-consulting.fr>
# Date 1655718307 -7200
#      Mon Jun 20 11:45:07 2022 +0200
# Node ID 023e0a13be484fa05fad868f0b79018484df343d
# Parent  3cd1dfb12d214f14d49f7c0048853a84589d5462
🚑 Fix path used when running chown in the image, it was using /var/lib/odoo which is not where the data is present when running

diff --git a/NEWS.rst b/NEWS.rst
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -5,6 +5,8 @@
 16.5.0
 ------
 
+Fix path used when running chown in the image, it was using /var/lib/odoo which is not where the data is present when running.
+
 When running tests, only install modules that are not going to be tested. Modules to be tested will be installed during the tests.
 
 16.4.0
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
@@ -616,6 +616,8 @@
             chown_directories.add(data_volume_path)
         arg.append("--data-dir")
         arg.append(data_volume_path)
+        if run_chown:
+            chown_directories.add(data_volume_path)
 
     # avoid the duplication of unbind volumes with all addons
     if odoo_type == ODOO_7:
@@ -653,8 +655,6 @@
     # make sure the permission in the volumes are correct
     if run_chown:
         chown_directories.add("/mnt")
-        if odoo_type not in (ODOO_7, ODOO_8):
-            chown_directories.add("/var/lib/odoo")
 
     if chown_directories:
         _logger.info("chown container’s %s to Odoo user", ", ".join(chown_directories))