Closed moylop260 closed 1 year ago
Instead of mutable, I'd name it translatable. Odoo has a native check to prevent filtering by string
@tde-banana-odoo
FYI a case was detected in odoo core of this lint check:
addons/l10n_ae_pos/static/src/xml/Screens/ReceiptScreen/OrderReceipt.xml:4 Use of translatable xpath `text()` - [xml-xpath-translatable-item]
Hello @moylop260 ,
Thanks for pointing it out :) a PR has been done to fix it at https://github.com/odoo/odoo/pull/104686 .
Cheers !
[ADD] xml-xpath-translatable-item: Add new check to identify mutable item used from xpath
Using the following
xpath
:It will raise error if the lang is changed since that the text is a translatable item
You should use no-mutable items in the xpath
e.g.
id
,name
qweb
key as item of datas from__manifest__.py
e.g. https://github.com/odoo/odoo/blob/57544f3b40d26e5c131cf4e3a2b0396a22b61bc6/addons/l10n_ae_pos/__manifest__.py#L12
assets
key as item of datas from__manifest__.py
e.g. https://github.com/odoo/odoo/blob/ae0a11a8ce3c35542ba5ae8f6366018b88ec40d5/addons/l10n_ae_pos/__manifest__.py#L14-L18