Thursday, February 3, 2022
6 changes · master
Enhancements to existing features
Odoo’s core page and report templating engine was consolidated and better documented, making it easier for developers to maintain and troubleshoot. This should improve long-term reliability and performance visibility for features that generate web pages, emails, and reports, with limited direct impact on daily users.
Original PR description
[IMP] IrQweb: merge Qweb engine file qweb.py and ir_qweb.py and add doc QWeb is the primary templating engine used by Odoo. It is an XML templating engine and used mostly to generate XML, HTML…
[IMP] IrQweb: merge Qweb engine file qweb.py and ir_qweb.py and add doc
QWeb is the primary templating engine used by Odoo. It is an XML
templating engine and used mostly to generate XML, HTML fragments and
pages.
To create new XML template, please see QWeb Templates documentation <https://www.odoo.com/documentation/15.0/developer/reference/frontend/qweb.html>
In **input** you have an XML template giving the corresponding input
etree. Each etree input nodes are used to generate a python function.
This fonction is called and will give the XML **output**.
The ``_compile`` method is responsible to generate the function from the
etree, that function is a python generator that yield one output line at a
time. This generator is consumed by ``_render``. The generated function is
orm cached.
In the graphic below you can see theresume of the call of the methods
performed in the IrQweb class.
Odoo
┗━► _render (returns MarkupSafe)
┗━► _compile (returns function) ◄━━━━━━━━━┓
┗━► _compile_node (returns code string array) ◄━━━━━━━┓ ┃
┃ (add technical directives: t-inner-content, t-tag) ┃ ┃
┣━► _directives_eval_order (defined directive order) ┃ ┃
┃ ┃ ┃
┣━► _compile_directives (recursive) ◄━━━━┓ ┃ ┃
┃ ┣━► _compile_directive ┃ ┃ ┃
┃ ┃ ┗━► t-if ━━► _compile_directive_if ━┫ ┃ ┃
┃ ┃ ┗━► t-foreach ━━► _compile_directive_foreach ━┛ ┃ ┃
┃ ┃ ┗━► t-* ━━► ... ┃ ┃
┃ ┃ ┗━► t-inner-content ━━► _compile_directive_inner_content ◄━━━━┓ ━┛ ┃
┃ ┃ ┗━► t-tag ━━► _compile_directive_tag ━┫ ┃
┃ ┃ ┗━► t-call ━━► _compile_directive_call ━┫ ━━━┛
┃ ┃ ┗━► t-out ━━► _compile_directive_out ◄━┓ ━┫
┃ ┃ ┗━► t-field ━━► _compile_directive_field ━┛ ┃
┃ ┃ ┃
┗━━┻━► _compile_static_node ━┛Account creation can now be guided so users only see the account types relevant to the task they are performing. This helps reduce mistakes during accounting setup and keeps account data more consistent.
Original PR description
Users are able to create accounts without restriction on the type of account to be created. With this commit we provide a context key to limit available account types and thus minimise errors. part of task-2684816
Delivery carriers can now support shipping insurance for parcels that may be lost, stolen, or damaged in transit. This brings a common carrier service into the standard delivery app, making it easier to offer consistent insured shipping options.
Original PR description
Shipping insurance is a service which may reimburse senders whose parcels are lost, stolen, and/or damaged in transit. Since most shipping connectors provide it, it makes sense to put it in the base directory. task-2701459
The mail app now keeps track of the user's browser when managing messaging behavior such as notifications and message-related views. This helps make communication features more consistent and reliable across browser sessions.
Expense receipts uploaded for OCR now appear more clearly in the expenses list while they are being processed, and processing is triggered sooner after upload. The update also removes redundant attachment messages and fixes an issue when OCR cannot detect a currency in multi-currency setups.
Original PR description
task - 2687999
Asset-related purchase selections now show only journal items and accounts that match the asset, deferred revenue, or deferred expense being configured. This helps users choose the correct records faster and reduces accounting setup mistakes from using irrelevant account types.
Original PR description
Only include journal items which may be relevant when selecting a related purchase of an asset task-2684816