summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/fields
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2020-05-06 12:15:45 +0000
committerAaron Bohy <aab@odoo.com>2020-05-07 07:26:43 +0000
commitc88d9fc003ad47309db91b3ae9924ef3005a2eea (patch)
treebbddbc8227b2508e95c522b118685b3d7ce29a87 /addons/web/static/src/js/fields
parent1159dcadbff09db464c13af96e54d259395662ea (diff)
[IMP] web: remove _lt from env
Having _lt in the env doesn't make much sense, as it is useless at run time, and it would incite people to require 'web.env' to use it (at load time). The env should never be directly imported, it is automatically propagated from parents to children. To sum up, in Owl components: - when terms have to be translated at run time (e.g. in a function called when the user clicks on a button), the env is available and env._t must be used - when terms have to be translated at load time (e.g. a JS module defining a component with a translatable static property), one must require 'web.translation' and use function _lt it exports. closes odoo/odoo#50656 Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Diffstat (limited to 'addons/web/static/src/js/fields')
-rw-r--r--addons/web/static/src/js/fields/basic_fields_owl.js4
1 files changed, 1 insertions, 3 deletions
diff --git a/addons/web/static/src/js/fields/basic_fields_owl.js b/addons/web/static/src/js/fields/basic_fields_owl.js
index 8a5915410ee..507f883a85a 100644
--- a/addons/web/static/src/js/fields/basic_fields_owl.js
+++ b/addons/web/static/src/js/fields/basic_fields_owl.js
@@ -3,9 +3,7 @@ odoo.define('web.basic_fields_owl', function (require) {
const AbstractField = require('web.AbstractFieldOwl');
const CustomCheckbox = require('web.CustomCheckbox');
- const core = require('web.core');
-
- const _lt = core._lt;
+ const { _lt } = require('web.translation');
/**