[FIX] Fixed abstract form popup open editable mode

bzr revid: ggh@tinyerp.com-20130319085804-ghxdei3yf6lxqq8o
This commit is contained in:
ggh-openerp 2013-03-19 14:28:04 +05:30
parent db17c0e775
commit 04d28929d0
1 changed files with 4 additions and 4 deletions

View File

@ -213,7 +213,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
});
//bounce effect on red button when click on statusbar.
this.$el.on('click', '.oe_form_field_status:not(.oe_form_status_clickable)', function (e) {
if((self.get("actual_mode") == "view") || (self.get("actual_mode") == "edit")) {
if(self.get("actual_mode") == "view") {
var $button = self.$el.find(".oe_highlight:not(.oe_form_invisible)").css({'float':'left','margin-left':'3px','margin-right':'2px','white-space':'nowrap'});
$button.openerpBounce();
e.stopPropagation();
@ -4596,13 +4596,13 @@ instance.web.form.AbstractFormPopup = instance.web.Widget.extend({
this.dataset.index = null;
}
var options = _.clone(self.options.form_view_options) || {};
if (this.row_id !== null) {
options.initial_mode = this.options.readonly ? "view" : "edit";
}
_.extend(options, {
$buttons: this.$buttonpane,
});
this.view_form = new instance.web.FormView(this, this.dataset, this.options.view_id || false, options);
if (this.row_id !== null) {
options.initial_mode = this.options.readonly ? "view" : this.view_form.options.initial_mode;
}
if (this.options.alternative_form_view) {
this.view_form.set_embedded_view(this.options.alternative_form_view);
}