Odoo's Mergebot 80b27a672f [MERGE] *: deprecate and replace non-owl t-raw
non-owl JS-side of #68072:

* deprecates `t-raw`
* adds a `t-out` which `t-esc` aliases and which "does the right thing"
* introduces a `Markup` function / object which is considered markup-safe by t-out (thus left unescaped)
  - unlike the python version, most of the override hooks (e.g. concatenation, formatting, ...) are not available in JS, we might eventually want to override some of the action methods (e.g. replace) but so far the needs seemed pretty limited
  - and javascript pretty strongly differentiates between a string (primitive) and a String (object), the latter being what Markup gets
  - so various constructs which can return a Markup in Python can't really afford to in JS: I tried with QWeb and e.g. jquery *really* does not deal well with non-primitive strings, as a result `_.escape` is shimmed to understand `Markup` objects but will not return markup objects when escaping strings
  - `sprintf` (the one from web.utils) was updated for Markup-awareness for convenience though
  - and `Markup` can be used as a template tag, in which case it will automatically escape the substitutions
- removed `messageIsHtml` from the non-owl notifications, replaced by the message being a markup object
- updated Dialog to work the same way (it did not even have a flag), removed explicit escaping from most of the callsites (only found one where we actually leveraged dialog titles being markup)
- modified the kanban view so HTML non-raw values automatically get wrapped in Markup

Also moved some formatting from the server to the client, either removing the need to inject markup entirely or making the use of `Markup` much cleaner than just "mark whatever the server returned as safe".

There are a few things I'm not entirely sure about e.g. whether even using markup is necessary for `formatMonetary`, doesn't the "unicode" NBSP work fine in HTML? Though we may need to keep `forceString` to ensure something like ascii-compatibility.

closes odoo/odoo#70004

Related: odoo/enterprise#18005
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2021-07-20 10:29:09 +02:00
2021-07-16 17:49:17 +00:00
…
…
…
…

Build Status Tech Doc Help Nightly Builds

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

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%