[IMP] web: downgrade warning messages to info

Two internal warnings are features which literally are not (entirely)
implemented, the tests can't be fixed to avoid them. Also augmented
the log messages with which test triggered the log, as it's very hard
to debug the issue otherwise.

As for the qweb debug mode warning, there's no way to disable it
easily because multiple tours explicitly opt into debug mode (with
good reasons), so it's not enough to just bypass the `mode` setter in
the test setup helpers (test_main in POS and main_tests in web), there
would also need to be special workarounds in the 4 modules which set
`owl.config.mode` based on the session's debug mode.

I don't know that this warning is even useful, it defaults to `false`
so the only situation in which this would be relevant would be for a
third-party to use Owl *and* explicitly enable the debug mode *and*
forget to remove it when deploying to production *and* look at their
console.
This commit is contained in:
Xavier Morel
2021-06-29 05:34:16 +00:00
parent 053285afdc
commit 1e6de40b78
2 changed files with 6 additions and 4 deletions
+4 -2
View File
@@ -2818,8 +2818,10 @@
set(mode) {
QWeb.dev = mode === "dev";
if (QWeb.dev) {
const url = `https://github.com/odoo/owl/blob/master/doc/reference/config.md#mode`;
console.warn(`Owl is running in 'dev' mode. This is not suitable for production use. See ${url} for more information.`);
console.info(`Owl is running in 'dev' mode.
This is not suitable for production use.
See https://github.com/odoo/owl/blob/master/doc/reference/config.md#mode for more information.`);
}
else {
console.log(`Owl is now running in 'prod' mode.`);
@@ -242,7 +242,7 @@ export class MockServer {
// TODO
// const pyevalContext = window.py.dict.fromJSON(context || {});
// var v = pyUtils.py_eval(mod, {context: pyevalContext}) ? true : false;
console.warn("MockServer: naive parse of modifier value");
console.info("MockServer: naive parse of modifier value in", QUnit.config.current.testName);
const v = JSON.parse(mod);
if (inTreeView && !inListHeader && attr === "invisible") {
modifiers.column_invisible = v;
@@ -808,7 +808,7 @@ export class MockServer {
res[groupByField] = val;
}
if (field.type === "date" && val) {
console.warn("Mock Server: read group not fully implemented (moment stuff)");
console.info("Mock Server: read group not fully implemented (moment stuff) in", QUnit.config.current.testName);
// const aggregateFunction = groupByField.split(':')[1];
// let startDate;
// let endDate;