4fedd2a490e63e59b3b38f9ee1075ef0efed3e24
Since commit [1], the lang was removed from the context by setting it to None. In Odoo 16 and since jsonb, it's not correct, the lang should simply be popped from the context. Indeed, having `lang=None` in the context will not return any value when reading the arch if the arch has no `en_US` default value. The previous commit will make it so the translations will be forwarded to custom snippets when saving a snippet. With that commit, the issue described above will be problematic and lead to a crash. There is probably other legit ways to reproduce the issue which are not yet found as we don't really use non english DB often. Step to reproduce (following previous commit): - Create a db with french only and install website. - Then enable dutch and add it on the website as second lang - Drop a title snippet & translate it in the dutch version - Save and go back to the main lang (fr) - Drag & drop again this newly saved snippet (custom snippet) - Save and to to dutch version - Enter translate mode -> A traceback will be shown, because `get_related_views` will fail on "empty etree document", because when in the stack doing `etree.fromstring(view.arch)`, it will fail since arch = ''. Step to reproduce (without the previous commit): - Remove the `en_US` jsonb key from a view, eg `update ir_ui_view set arch_db = (select arch_db - 'en_US' from ir_ui_view where id = 4) where id = 4;` - Start odoo-bin in `shell` mode - Do `self.env['ir.ui.view'].browse(4).arch` -> Will output the arch - Do `self.env['ir.ui.view'].browse(4).with_context(lang=None).arch` -> This will crash on record not found error. [1]: https://github.com/odoo/odoo/commit/fdb9f8273be62d0a6d8051f7ca0a66cdf22ae5e7 task-3375518 X-original-commit: 9cb17bc9cb1490219d1488c99e419a84681ca121 Part-of: odoo/odoo#150945
…
…
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
Getting started with Odoo
For a standard installation please follow the Setup instructions from the documentation.
To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%