diff --git a/odoo/addons/base/module/module.py b/odoo/addons/base/module/module.py index 233d12cb370..4d3e859352b 100644 --- a/odoo/addons/base/module/module.py +++ b/odoo/addons/base/module/module.py @@ -643,6 +643,15 @@ class Module(models.Model): if not self.env.user.has_group('base.group_system'): raise AccessDenied() + # One-click install is opt-in - cfr Issue #15225 + ad_dir = tools.config.addons_data_dir + if not os.access(ad_dir, os.W_OK): + msg = (_("Automatic install of downloaded Apps is currently disabled.") + "\n\n" + + _("To enable it, make sure this directory exists and is writable on the server:") + + "\n%s" % ad_dir) + _logger.warning(msg) + raise UserError(msg) + apps_server = urlparse.urlparse(self.get_apps_server()) OPENERP = odoo.release.product_name.lower() diff --git a/odoo/modules/module.py b/odoo/modules/module.py index 014f2d0ed9b..ecf95be088b 100644 --- a/odoo/modules/module.py +++ b/odoo/modules/module.py @@ -128,7 +128,7 @@ def initialize_sys_path(): global hooked dd = tools.config.addons_data_dir - if dd not in ad_paths: + if os.access(dd, os.R_OK) and dd not in ad_paths: ad_paths.append(dd) for ad in tools.config['addons_path'].split(','): diff --git a/odoo/tools/config.py b/odoo/tools/config.py index 2473fe53304..fb29d0d4a83 100644 --- a/odoo/tools/config.py +++ b/odoo/tools/config.py @@ -582,10 +582,11 @@ class configmanager(object): def addons_data_dir(self): d = os.path.join(self['data_dir'], 'addons', release.series) if not os.path.exists(d): - os.makedirs(d, 0700) - else: - assert os.access(d, os.W_OK), \ - "%s: directory is not writable" % d + try: + # try to make +rx placeholder dir, will need manual +w to activate it + os.makedirs(d, 0500) + except OSError: + logging.getLogger(__name__).debug('Failed to create addons data dir %s', d) return d @property