Thursday, February 3, 2022
13 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 ━┛The mail module was updated to use a newer internal component access pattern. This helps keep the codebase aligned with current framework practices and supports easier maintenance without changing user-facing behavior.
Original PR description
Part of task-2694208
Adds support for storno accounting, where refunds and reversals are recorded as negative amounts on the same debit or credit side instead of switching sides. This helps businesses in countries where storno accounting is required or common stay compliant, with the option enabled automatically for relevant localizations and configurable in accounting settings.
Original PR description
Storno accounting is the term used to described the process of recording a reverse action as a negative amount on the same site instead of a positive amount on the opposite site of the credit/debit.…
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
Payment tests no longer add CSRF tokens to JSON-based requests because those tokens are not used for that request type. This keeps the test setup simpler and better aligned with how the system actually handles these requests, with no expected impact on users.
Original PR description
The CSRF token is not checked for JSON(-RPC) requests.
This update standardizes how chat and messaging components receive styling information, helping keep the interface more consistent across live chat and mail screens. It is a minor internal improvement that supports easier maintenance without changing core user workflows.
Original PR description
Part of task-2694196
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
This update adds test coverage to ensure file upload activities keep the correct activity type when changed. It reduces the risk of future regressions in the mail activity workflow without changing the user experience directly.
Original PR description
Some recent changes have evidenced that the modification of the activity type of an 'upload_file' activity was not properly covered by the tests. This commit adds a new test for this specific case. Part of task-2730667
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.
This update tidies internal naming for attachment lists in Odoo's mail features. It helps keep the code easier to maintain without changing how users interact with email attachments.
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
Several reporting and customization components were adjusted to stay compatible with recent platform changes in Odoo's report rendering engine. This helps ensure invoices, delivery documents, tax reports, and worksheet templates continue to generate reliably after the underlying technical update.
Original PR description
[IMP] web_studio: addapt to community merge file qweb.py and ir_qweb.py [IMP] web_studio: addapt to changes: IrQweb remove compiling recursivity
Storno accounting is the term used to described the process of recording a reverse action as a negative amount on the same site instead of a positive amount on the opposite site of the credit/debit. For instance, when one creates a credit note for an invoice, the values of debit and credit will be kept in the same column with negative signs instead of swapping columns like in non-Storno accounting. The following invoice  will generate the following credit note  instead of  Storno accounting is available as an option in the settings and is automatically activated for some countries which use this type of accounting such as Croatia or Slovenia. Related upgrade script: https://github.com/odoo/upgrade/pull/3212 task-2064899