[IMP] hiding of readonly form fields in edition row: don't directly access DOM visibility properties

bzr revid: xmo@openerp.com-20120703110700-k0dqtthwo1g36pod
This commit is contained in:
Xavier Morel 2012-07-03 13:07:00 +02:00
parent ae6c6eb8ec
commit 336443d604
1 changed files with 7 additions and 9 deletions

View File

@ -150,18 +150,16 @@ openerp.web.list_editable = function (instance) {
}, self.editor.edit,
[record.attributes, function (field_name, field) {
var cell = cells[field_name];
if (!cell) { return; }
if (!cell || field.get('effective_readonly')) {
// Readonly fields can just remain the list's, form's
// usually don't have backgrounds &al
field.set({invisible: true});
return;
}
var $cell = $(cell);
var position = $cell.position();
// FIXME: this is shit. Is it possible to prefilter?
if (field.get('effective_readonly')) {
// Readonly fields can just remain the list's, form's
// usually don't have backgrounds &al
field.$element.hide();
return;
}
field.$element.show().css({
field.$element.css({
top: position.top,
left: position.left,
width: $cell.outerWidth(),