diff options
| author | Géry Debongnie <ged@odoo.com> | 2017-07-05 13:41:24 +0200 |
|---|---|---|
| committer | Géry Debongnie <ged@odoo.com> | 2017-07-05 14:47:11 +0200 |
| commit | a43b0464b28ce53074b027469747e379bbb389c4 (patch) | |
| tree | 4166717ec907ca674adbf7035eeca1c8c08707c6 /addons/web/static/tests/views/basic_model_tests.js | |
| parent | 780ae8a808697cc156549e532614f8536cef2b1b (diff) | |
[FIX] web: better handling for readonly modifiers
Before this commit, the web client read the readonly in the modifiers,
and if no readonly was in the modifiers, it fell back to the field
property. But the field property was already taken into account in the
modifiers, so this was useless. And worse, in some case, it could cause
an issue. For example, a field with readonly=true, and readonly="0" in
the arch was considered readonly.
Diffstat (limited to 'addons/web/static/tests/views/basic_model_tests.js')
| -rw-r--r-- | addons/web/static/tests/views/basic_model_tests.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/addons/web/static/tests/views/basic_model_tests.js b/addons/web/static/tests/views/basic_model_tests.js index eb068f4214c..7f7547262da 100644 --- a/addons/web/static/tests/views/basic_model_tests.js +++ b/addons/web/static/tests/views/basic_model_tests.js @@ -1418,7 +1418,14 @@ QUnit.module('Views', { this.data.partner.onchanges.foo = function (obj) { obj.bar = obj.foo.length; }; - this.data.partner.fields.bar.readonly = true; + this.params.fieldsInfo = { + default: { + foo: {}, + bar: { + modifiers:"{\"readonly\": true}", + }, + } + }; var model = createModel({ Model: BasicModel, |
