[FIX] xmo@openerp.com-20120209090214-84d6jjr1jnf32kpi excluded too many fields
previous change would exclude all fields with @readonly, but @state can remove @readonly from fields and means fields are importable again (pretty much). Need to add that, otherwise it's almost impossible to import stuff bzr revid: xmo@openerp.com-20120216163155-wh8uory00i2qifxy
This commit is contained in:
@@ -109,9 +109,19 @@ 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' || field.readonly) {
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user