Apply saved optional to column with the optional attribute
If the same column is added twice in a view with and without optional, only the columns with optional attribute must be updated.
This commit is contained in:
@@ -826,8 +826,9 @@
|
||||
return;
|
||||
}
|
||||
var optional;
|
||||
if (Object.prototype.hasOwnProperty.call(
|
||||
tree_column_optional, name)) {
|
||||
if ((column.attributes.optional) &&
|
||||
Object.prototype.hasOwnProperty.call(
|
||||
tree_column_optional, name)) {
|
||||
optional = tree_column_optional[name];
|
||||
} else {
|
||||
optional = Boolean(parseInt(
|
||||
|
||||
@@ -1166,7 +1166,8 @@ class ViewTree(View):
|
||||
continue
|
||||
widget = self.get_column_widget(column)
|
||||
widget.set_editable()
|
||||
if column.name in tree_column_optional:
|
||||
if ('optional' in widget.attrs
|
||||
and column.name in tree_column_optional):
|
||||
optional = tree_column_optional[column.name]
|
||||
else:
|
||||
optional = bool(int(widget.attrs.get('optional', '0')))
|
||||
|
||||
Reference in New Issue
Block a user