[IMP] Addded the common view attrib check method for the access ui support
bzr revid: jam@tinyerp.com-20120814133242-y7ofa6oy59gj0uj4
This commit is contained in:
parent
076fdb0994
commit
9c04845999
|
@ -1050,9 +1050,6 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
|
|||
open_translate_dialog: function(field) {
|
||||
return this._super(field);
|
||||
},
|
||||
_is_action_enabled: function(action) {
|
||||
return (_.has(this.fields_view.arch.attrs, action))?JSON.parse(this.fields_view.arch.attrs[action]):true;
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
|
@ -835,9 +835,6 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
|
|||
this.$element.prepend(
|
||||
$('<div class="oe_view_nocontent">').html(this.options.action.help)
|
||||
);
|
||||
},
|
||||
_is_action_enabled: function(action) {
|
||||
return (_.has(this.fields_view.arch.attrs, action))?JSON.parse(this.fields_view.arch.attrs[action]):true;
|
||||
}
|
||||
});
|
||||
instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web.ListView.List# */{
|
||||
|
|
|
@ -1357,6 +1357,14 @@ instance.web.View = instance.web.Widget.extend({
|
|||
*/
|
||||
reload: function () {
|
||||
return $.when();
|
||||
},
|
||||
_is_action_enabled: function(action) {
|
||||
/**
|
||||
* Takes action (e.g. create/edit/delete) and return the tag attribute from
|
||||
* the view (e.g. <from string="" create="false" edit="false" delete="false">)
|
||||
* will help to check access ui of the view.
|
||||
*/
|
||||
return (_.has(this.fields_view.arch.attrs, action))?JSON.parse(this.fields_view.arch.attrs[action]):true;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue