Thursday, January 15, 2026
2 changes · master
Code cleanup and technical improvements
This pull request improves the consistency and readability of the Amazon and Shopee integration code by applying linting and formatting. Specifically, error handling has been refined to focus only on errors related to API requests, ensuring a cleaner and more maintainable codebase. This change doesn't impact functionality.
Original PR description
task-5436779 See also: - https://github.com/odoo/odoo/pull/243877
This update introduces a unified template for generating Point of Sale receipts across multiple Odoo modules. By consolidating receipt templates, maintenance is simplified and ensures consistent formatting for all POS transactions. This change avoids duplication and improves overall system efficiency.
Original PR description
*: l10n_at_pos, l10n_br_edi_pos, l10n_de_pos_cert, l10n_eu_iot_scale_cert, l10n_ke_edi_oscu_pos, l10n_se_pos, pos_tyro, pos_blackbox_be, pos_enterprise, pos_urban_piper This commit introduces a new…
*: l10n_at_pos, l10n_br_edi_pos, l10n_de_pos_cert,
l10n_eu_iot_scale_cert, l10n_ke_edi_oscu_pos, l10n_se_pos, pos_tyro,
pos_blackbox_be, pos_enterprise, pos_urban_piper
This commit introduces a new `point_of_sale.pos_order_receipt` template
that can be used to generate receipts via the QWeb Python & JS renderer.
The main idea was to avoid duplicating the receipt template, as it is
overridden in almost all modules related to the Point of Sale.
Duplicating this template would have been tedious to maintain.
As a result, this new template stored in the Point of Sale data is a
"simple" template in which we cannot use directives that are only
understandable by Python or JS. Here are the directives that can be used
- `t-if`
- `t-elif`
- `t-else`
- `t-foreach`
- `t-att-*`
- `t-attf-*`
- `t-call`
- `t-out`
- `t-set`
- `t-as`
- `t-name`
- `t-value`
This template then takes a pre-built object from a command and retrieves
all the necessary information from it. It is important to remember that
JS and Python must generate the same object.
---
About evaluations:
JS rendering is more permissive than Python. For example, calling an
undefined index `order['lines']['data']` will be accepted by JS but not
by Python.
We therefore assume that Python will be the reference when modifying
the template.
Complex evaluations in Python/JS are not allowed, as they require overly
complex conversion.
---
Template conversion:
When downloading the template in JS, these conversions are performed:
- Addition of `t-key` for `t-foreach`
- Replacement of `.get('something')` with `['something']`
- The operator `and` becomes `&&`.
- The `or` operator becomes `||`.
- The `not` operator becomes `!`.
- `True` becomes `true`
- `False` becomes `false`
- `None` becomes `null`
This conversion is simple and matches the template's requirements.
The method used cannot be used with other ASIS backend templates.
taskId: 5113480