[IMP] fix code spacing and indentation

bzr revid: rco@openerp.com-20120831153758-3l46jbvtifix5s9v
This commit is contained in:
Raphael Collet 2012-08-31 17:37:58 +02:00
parent 0304a1eada
commit 3e5c6a4d95
6 changed files with 22 additions and 22 deletions

View File

@ -150,7 +150,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
}
if (self._is_action_enabled('delete')) {
this.sidebar.add_items('other', [
{ label: _t('Delete'), callback: self.on_button_delete },
{ label: _t('Delete'), callback: self.on_button_delete }
]);
}
if (self._is_action_enabled('create')) {
@ -3469,8 +3469,8 @@ instance.web.form.One2ManyListView = instance.web.ListView.extend({
}
},
do_activate_record: function(index, id) {
var self = this,
attr_readonly = (_.has(this.fields_view.arch.attrs, 'edit'))?JSON.parse(this.fields_view.arch.attrs.edit):true;
var self = this;
var attr_readonly = (_.has(this.fields_view.arch.attrs, 'edit')) ? JSON.parse(this.fields_view.arch.attrs.edit) : true;
var pop = new instance.web.form.FormOpenPopup(self.o2m.view);
pop.show_element(self.o2m.field.relation, id, self.o2m.build_context(), {
title: _t("Open: ") + self.o2m.string,

View File

@ -1358,12 +1358,12 @@ 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 whether the user can perform the action ('create', 'edit', 'delete') in this view.
* An action is disabled by setting the corresponding attribute in the view's main element,
* like: <form string="" create="false" edit="false" delete="false">
*/
_is_action_enabled: function(action) {
return (_.has(this.fields_view.arch.attrs, action)) ? JSON.parse(this.fields_view.arch.attrs[action]) : true;
}
});