[IMP] use list.Column's parsed (and potentially altered) modifiers to generate the edition form view
This way, listview 'widgets' can alter the modifiers object and influence the corresponding form widget bzr revid: xmo@openerp.com-20120904115627-v626hcb9o0s7bcrp
This commit is contained in:
parent
58a5e1c013
commit
b4e20f0c14
|
@ -2115,6 +2115,11 @@ instance.web.list.ProgressBar = instance.web.list.Column.extend({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
instance.web.list.Handle = instance.web.list.Column.extend({
|
instance.web.list.Handle = instance.web.list.Column.extend({
|
||||||
|
init: function () {
|
||||||
|
this._super.apply(this, arguments);
|
||||||
|
// Handle overrides the field to not be form-editable.
|
||||||
|
this.modifiers.readonly = true;
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* Return styling hooks for a drag handle
|
* Return styling hooks for a drag handle
|
||||||
*
|
*
|
||||||
|
|
|
@ -354,14 +354,17 @@ openerp.web.list_editable = function (instance) {
|
||||||
'class': 'oe_form_container',
|
'class': 'oe_form_container',
|
||||||
version: '7.0'
|
version: '7.0'
|
||||||
});
|
});
|
||||||
_(view.arch.children).each(function (widget) {
|
_(view.arch.children).chain()
|
||||||
var modifiers = JSON.parse(widget.attrs.modifiers || '{}');
|
.zip(this.columns)
|
||||||
widget.attrs.nolabel = true;
|
.each(function (ar) {
|
||||||
if (modifiers['tree_invisible'] || widget.tag === 'button') {
|
var widget = ar[0], column = ar[1];
|
||||||
modifiers.invisible = true;
|
var modifiers = _.extend({}, column.modifiers);
|
||||||
}
|
widget.attrs.nolabel = true;
|
||||||
widget.attrs.modifiers = JSON.stringify(modifiers);
|
if (modifiers['tree_invisible'] || widget.tag === 'button') {
|
||||||
});
|
modifiers.invisible = true;
|
||||||
|
}
|
||||||
|
widget.attrs.modifiers = JSON.stringify(modifiers);
|
||||||
|
});
|
||||||
return view;
|
return view;
|
||||||
},
|
},
|
||||||
handle_onwrite: function (source_record) {
|
handle_onwrite: function (source_record) {
|
||||||
|
|
Loading…
Reference in New Issue