Tuesday, May 20, 2025
3 changes · 18.0
Resolved issues and error corrections
Restaurant receipt wording is now translated as complete phrases instead of separate fragments, making translations more natural across languages. This also avoids confusion between restaurant tables and spreadsheet tables in translated text.
Original PR description
Do not use t-out/t-esc to build human-readable content. This is basically the same as string concatenation. This commit wraps the entire string in a gettext call to prevent it from being split into several non-reorderable translations. As a lucky side effect, it also creates a separate translation for the word "table" (as in restaurant tables) which won't overlap with the translation for spreadsheet tables. opw-4754410
This fix makes an internal stock landed costs test use a reliable ordering method so automated checks no longer fail unpredictably. It helps keep the development pipeline stable without changing business functionality or user workflows.
Original PR description
Issue ===== In the test `test_stock_landed_costs_lots`, there is this `assertRecordValues`: ```python self.assertRecordValues(lc.stock_valuation_layer_ids.sorted('product_id'), [ {'lot_id':…
Issue
=====
In the test `test_stock_landed_costs_lots`, there is this `assertRecordValues`:
```python
self.assertRecordValues(lc.stock_valuation_layer_ids.sorted('product_id'), [
{'lot_id': lot_product_b[0].id, 'product_id': product2.id, 'stock_valuation_layer_id': og_p2_layers[0].id, 'quantity': 0, 'value': 1.5},
{'lot_id': lot_product_b[1].id, 'product_id': product2.id, 'stock_valuation_layer_id': og_p2_layers[1].id, 'quantity': 0, 'value': 1.5},
{'lot_id': lot_product_a[0].id, 'product_id': self.product1.id, 'stock_valuation_layer_id': og_p1_layers[0].id, 'quantity': 0, 'value': 1},
{'lot_id': lot_product_a[1].id, 'product_id': self.product1.id, 'stock_valuation_layer_id': og_p1_layers[1].id, 'quantity': 0, 'value': 1},
{'lot_id': lot_product_a[2].id, 'product_id': self.product1.id, 'stock_valuation_layer_id': og_p1_layers[2].id, 'quantity': 0, 'value': 1},
])
```
This issue is sometime the records order is not the expected one.
Cause of the issue
==================
By doing `recordset.sorted('product_id')`, it will sort the records by compare their `product_id` records, using the python built-in `sorted`. The built-in `sorted` function simply check if record A is lower than record B, using the < operation. But in Odoo, comparing two recordsets is equal than comparing their ids as a `set`:
```python
def __lt__(self, other):
try:
if self._name == other._name:
return set(self._ids) < set(other._ids)
except AttributeError:
pass
return NotImplemented
```
In python, the comparaison between two sets compares is a set is a subset of the other one, which means than:
```python
{1} < {2} # is false
{1} < {2, 1} # is true
```
So, comparing SVLs by their product won't sort them by their product's id. If we want to do that, we have to explicitly do it by passing a function as the `sorted` `key` argument.
For more information, see:
-https://docs.python.org/3/library/functions.html#sorted -https://docs.python.org/3/reference/expressions.html#comparisons
runbot-build-error: 99086DIN5008 formatted reports now show partner and shipping addresses with the same font size. This fixes a visual inconsistency in printed quotations, making customer-facing documents look more polished and uniform.
Original PR description
### Steps to reproduce: - Install "l10n_din5008" - In Settings > Layout, select DIN5008 as the report layout - Create a quotation, print it - The address of the partner and the sipping address have different font size ### Cause: Since this [commit](https://github.com/odoo/odoo/commit/92e4c3cb3bec0b3d5537a50fd441a22fa6509ed1) the partner address is a span which is applied a [`font-size: 0.8em;`](https://github.com/odoo/odoo/blob/f77b40bba0c92a9a225eb7ade694e79cb804f7bf/addons/l10n_din5008/static/src/scss/report_din5008.scss#L51). But not the shipping address. ### Solution: Remove the restriction of `span` to apply the font-size. This way all text in address should have the same font-size. Before:  After:  opw-4725169