-
- Downloads
[IMP] *: remove `_render` from `ir.ui.view` and simplify report
There were inconsistencies in the calls to `_render`. * the view context could contain information that misled developers. Indeed, the context and value of the view are not supposed to be found in the rendering. Thus by calling `ir.qweb` with the name of the template, we ensure that there is no unwanted information and in addition the cache key is that of the name of the template which saves a query. * the context used for rendering was modified by a method on `ir.ui.view`, except this is not information used by this model. There is now a `_prepare_environment` method residing on `ir.qweb`. This method allows to modify the value dictionary as well as the context in which the rendering will be done. This preparation of the data as well as my security check is done only once per rendering. This also saves some queries * Freeze options for rendering were inconsistent. It could be that options on which rendering depends were not part of the cache key. Thus, depending on the user who generated the generation of the rendering function, there was or was not information in the template. For example for automatic branding. This is no longer possible, because it is the context that is used. The options serving as a cache key are only recorded for information (for the profiling system for example). A simplification of the `ir.qweb.field` models could be made. The report rendering and call `ir.qweb` instead of `ir.ui.view`. Part-of: odoo/odoo#85110
Showing
- addons/account/controllers/onboarding.py 2 additions, 2 deletionsaddons/account/controllers/onboarding.py
- addons/account/models/company.py 5 additions, 5 deletionsaddons/account/models/company.py
- addons/account/wizard/account_tour_upload_bill.py 1 addition, 1 deletionaddons/account/wizard/account_tour_upload_bill.py
- addons/account_edi_facturx/models/account_edi_format.py 6 additions, 5 deletionsaddons/account_edi_facturx/models/account_edi_format.py
- addons/account_edi_ubl/models/account_edi_format.py 1 addition, 1 deletionaddons/account_edi_ubl/models/account_edi_format.py
- addons/crm/tests/test_performances.py 2 additions, 2 deletionsaddons/crm/tests/test_performances.py
- addons/hr_expense/models/hr_expense.py 1 addition, 2 deletionsaddons/hr_expense/models/hr_expense.py
- addons/hr_work_entry_holidays/tests/test_performance.py 1 addition, 1 deletionaddons/hr_work_entry_holidays/tests/test_performance.py
- addons/http_routing/models/__init__.py 1 addition, 1 deletionaddons/http_routing/models/__init__.py
- addons/http_routing/models/ir_qweb.py 52 additions, 0 deletionsaddons/http_routing/models/ir_qweb.py
- addons/http_routing/models/ir_ui_view.py 0 additions, 16 deletionsaddons/http_routing/models/ir_ui_view.py
- addons/im_livechat/models/im_livechat_channel.py 1 addition, 2 deletionsaddons/im_livechat/models/im_livechat_channel.py
- addons/im_livechat/models/mail_channel.py 1 addition, 2 deletionsaddons/im_livechat/models/mail_channel.py
- addons/l10n_be_edi/models/account_edi_format.py 1 addition, 1 deletionaddons/l10n_be_edi/models/account_edi_format.py
- addons/l10n_it_edi/models/account_invoice.py 1 addition, 1 deletionaddons/l10n_it_edi/models/account_invoice.py
- addons/l10n_nl_edi/models/account_edi_format.py 1 addition, 1 deletionaddons/l10n_nl_edi/models/account_edi_format.py
- addons/l10n_no_edi/models/account_edi_format.py 1 addition, 1 deletionaddons/l10n_no_edi/models/account_edi_format.py
- addons/mail/models/mail_activity.py 6 additions, 10 deletionsaddons/mail/models/mail_activity.py
- addons/mail/models/mail_activity_mixin.py 2 additions, 7 deletionsaddons/mail/models/mail_activity_mixin.py
- addons/mail/models/mail_alias.py 2 additions, 3 deletionsaddons/mail/models/mail_alias.py
Loading