diff options
| author | Raphael Collet <rco@odoo.com> | 2020-04-02 06:45:54 +0000 |
|---|---|---|
| committer | Raphael Collet <rco@odoo.com> | 2020-04-03 11:40:30 +0000 |
| commit | 8a3e1a0ccdad25ba5b4b99639bdaeb9073a27f1f (patch) | |
| tree | f823adf145ce115386ce11b2d57494d2fef7470a /odoo | |
| parent | a233d534c2c4e9f1417c85ead92249a5d8c83b3a (diff) | |
[IMP] ir.ui.view: call _update_user_groups_view() once per install
This saves 1.5% of the total installation time.
X-original-commit: afd39e1a9824252d13823e484c60ad813b9b51a6
Diffstat (limited to 'odoo')
| -rw-r--r-- | odoo/addons/base/models/res_users.py | 5 | ||||
| -rw-r--r-- | odoo/modules/loading.py | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/odoo/addons/base/models/res_users.py b/odoo/addons/base/models/res_users.py index abdac34ce09..b605362853a 100644 --- a/odoo/addons/base/models/res_users.py +++ b/odoo/addons/base/models/res_users.py @@ -18,6 +18,7 @@ from lxml.builder import E import passlib.context from odoo import api, fields, models, tools, SUPERUSER_ID, _ +from odoo.addons.base.models.ir_model import MODULE_UNINSTALL_FLAG from odoo.exceptions import AccessDenied, AccessError, UserError, ValidationError from odoo.http import request from odoo.osv import expression @@ -1085,6 +1086,10 @@ class GroupsView(models.Model): """ Modify the view with xmlid ``base.user_groups_view``, which inherits the user form view, and introduces the reified group fields. """ + if self._context.get('install_filename') or self._context.get(MODULE_UNINSTALL_FLAG): + # skip now; it will be updated once at the end of (un)installation + return + # remove the language to avoid translations, it will be handled at the view level self = self.with_context(lang=None) diff --git a/odoo/modules/loading.py b/odoo/modules/loading.py index e9c215dc49b..070bd325d18 100644 --- a/odoo/modules/loading.py +++ b/odoo/modules/loading.py @@ -527,6 +527,7 @@ def load_modules(db, force_demo=False, status=None, update_module=False): # STEP 6: verify custom views on every model if update_module: env = api.Environment(cr, SUPERUSER_ID, {}) + env['res.groups']._update_user_groups_view() View = env['ir.ui.view'] for model in registry: try: |
