diff options
| author | niv-openerp <nicolas.vanhoren@openerp.com> | 2012-02-17 11:17:31 +0100 |
|---|---|---|
| committer | niv-openerp <nicolas.vanhoren@openerp.com> | 2012-02-17 11:17:31 +0100 |
| commit | 1e9380b8faf05aa5ccb7fdfaf7309c362b1963bb (patch) | |
| tree | e49a42e01b00a5e95522a93c720762d487b17fd8 /addons/web/static/src/js/data_import.js | |
| parent | affc2d4d04539d452ee207eef2c01238df72d1ef (diff) | |
| parent | 9f65e1565e785fd1c11fef65e7b49e78fba290ed (diff) | |
[merge]
bzr revid: nicolas.vanhoren@openerp.com-20120217101731-3g9hrhs65qb32pkv
Diffstat (limited to 'addons/web/static/src/js/data_import.js')
| -rw-r--r-- | addons/web/static/src/js/data_import.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/addons/web/static/src/js/data_import.js b/addons/web/static/src/js/data_import.js index 18870ca2157..83eea2cccbb 100644 --- a/addons/web/static/src/js/data_import.js +++ b/addons/web/static/src/js/data_import.js @@ -109,9 +109,20 @@ openerp.web.DataImport = openerp.web.Dialog.extend({ _(fields).each(function (field, field_name) { // Ignore spec for id field // Don't import function fields (function and related) - if (field_name === 'id' || 'function' in field) { + if (field_name === 'id') { return; } + // Skip if there's no state which could disable @readonly, + // if a field is ever always readonly we can't import it + if (field.readonly) { + // no states at all + if (_.isEmpty(field.states)) { return; } + // no state altering @readonly + if (!_.any(field.states, function (modifiers) { + return _(modifiers).chain().pluck(0).contains('readonly').value(); + })) { return; } + } + var f = { id: field_name, name: field_name, |
