diff --git a/odoo/addons/base/module/module.py b/odoo/addons/base/module/module.py index 1b93def194b..fde49e72885 100644 --- a/odoo/addons/base/module/module.py +++ b/odoo/addons/base/module/module.py @@ -342,7 +342,7 @@ class Module(models.Model): raise UserError(msg % (module_name, e.args[0])) @api.multi - def state_update(self, newstate, states_to_update, level=100): + def _state_update(self, newstate, states_to_update, level=100): if level < 1: raise UserError(_('Recursion error in modules dependencies !')) @@ -361,7 +361,7 @@ class Module(models.Model): update_mods += dep.depend_id # update dependency modules that require it, and determine demo for module - update_demo = update_mods.state_update(newstate, states_to_update, level=level-1) + update_demo = update_mods._state_update(newstate, states_to_update, level=level-1) module_demo = module.demo or update_demo or any(mod.demo for mod in ready_mods) demo = demo or module_demo @@ -389,7 +389,7 @@ class Module(models.Model): modules = self while modules: # Mark the given modules and their dependencies to be installed. - modules.state_update('to install', ['uninstalled']) + modules._state_update('to install', ['uninstalled']) # Determine which auto-installable modules must be installed. modules = self.search(auto_domain).filtered(must_install) @@ -807,9 +807,8 @@ class Module(models.Model): cat_id = modules.db.create_categories(self._cr, categs) self.write({'category_id': cat_id}) - @assert_log_admin_access @api.multi - def update_translations(self, filter_lang=None): + def _update_translations(self, filter_lang=None): if not filter_lang: langs = self.env['res.lang'].search([('translatable', '=', True)]) filter_lang = [lang.code for lang in langs] @@ -819,7 +818,7 @@ class Module(models.Model): self.env['ir.translation'].load_module_terms(mod_names, filter_lang) @api.multi - def check(self): + def _check(self): for module in self: if not module.description: _logger.warning('module %s: description is empty !', module.name) diff --git a/odoo/addons/base/module/wizard/base_language_install.py b/odoo/addons/base/module/wizard/base_language_install.py index 10fb90311fa..78eb3009372 100644 --- a/odoo/addons/base/module/wizard/base_language_install.py +++ b/odoo/addons/base/module/wizard/base_language_install.py @@ -22,7 +22,7 @@ class BaseLanguageInstall(models.TransientModel): def lang_install(self): self.ensure_one() mods = self.env['ir.module.module'].search([('state', '=', 'installed')]) - mods.with_context(overwrite=self.overwrite).update_translations(self.lang) + mods.with_context(overwrite=self.overwrite)._update_translations(self.lang) self.state = 'done' return { 'name': _('Language Pack'), diff --git a/odoo/modules/loading.py b/odoo/modules/loading.py index f8c65d40177..5952fa499b9 100644 --- a/odoo/modules/loading.py +++ b/odoo/modules/loading.py @@ -148,7 +148,7 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules= module = env['ir.module.module'].browse(module_id) if perform_checks: - module.check() + module._check() if package.state=='to upgrade': # upgrading the module information @@ -164,7 +164,7 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules= # Update translations for all installed languages overwrite = odoo.tools.config["overwrite_existing_translations"] - module.with_context(overwrite=overwrite).update_translations() + module.with_context(overwrite=overwrite)._update_translations() registry._init_modules.add(package.name) diff --git a/odoo/service/db.py b/odoo/service/db.py index 7f496556caf..f4acace4740 100644 --- a/odoo/service/db.py +++ b/odoo/service/db.py @@ -55,7 +55,7 @@ def _initialize_db(id, db_name, demo, lang, user_password, login='admin', countr if lang: modules = env['ir.module.module'].search([('state', '=', 'installed')]) - modules.update_translations(lang) + modules._update_translations(lang) if country_code: countries = env['res.country'].search([('code', 'ilike', country_code)])