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 | 0563093d1e3794988f5e17bb6ee89aa0a400a359 (patch) | |
| tree | ecdb4e3d4fee5837b74601e40528d6567f65134a /odoo | |
| parent | 8a3e1a0ccdad25ba5b4b99639bdaeb9073a27f1f (diff) | |
[IMP] ir.ui.view: optimize `_compute_arch`
Simply avoid computing a field when not necessary.
This saves 0.5% of the total installation time.
closes odoo/odoo#48967
X-original-commit: f3fa93228b6ea8e9e171aaa508ca0218d70406f3
Related: odoo/enterprise#9655
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Diffstat (limited to 'odoo')
| -rw-r--r-- | odoo/addons/base/models/ir_ui_view.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/odoo/addons/base/models/ir_ui_view.py b/odoo/addons/base/models/ir_ui_view.py index fa9640a479e..3ed1603efb2 100644 --- a/odoo/addons/base/models/ir_ui_view.py +++ b/odoo/addons/base/models/ir_ui_view.py @@ -268,10 +268,10 @@ actual arch. for view in self: arch_fs = None - xml_id = view.xml_id or view.key read_file = self._context.get('read_arch_from_file') or \ ('xml' in config['dev_mode'] and not view.arch_updated) - if read_file and view.arch_fs and xml_id: + if read_file and view.arch_fs and (view.xml_id or view.key): + xml_id = view.xml_id or view.key # It is safe to split on / herebelow because arch_fs is explicitely stored with '/' fullpath = get_resource_path(*view.arch_fs.split('/')) if fullpath: |
