[FIX] call super method in m2oreadonly widget.

lp bug: https://launchpad.net/bugs/878033 fixed

bzr revid: ysa@tinyerp.com-20111019125034-2n7d9yrp53la4zdc
This commit is contained in:
Yogesh (OpenERP) 2011-10-19 18:20:34 +05:30
parent bd6d9a5b98
commit fecb2ee680
1 changed files with 8 additions and 7 deletions

View File

@ -15,7 +15,7 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView#
/** /**
* @constructs openerp.web.FormView * @constructs openerp.web.FormView
* @extends openerp.web.View * @extends openerp.web.View
* *
* @param {openerp.web.Session} session the current openerp session * @param {openerp.web.Session} session the current openerp session
* @param {openerp.web.DataSet} dataset the dataset this view will work with * @param {openerp.web.DataSet} dataset the dataset this view will work with
* @param {String} view_id the identifier of the OpenERP view object * @param {String} view_id the identifier of the OpenERP view object
@ -1007,7 +1007,7 @@ openerp.web.form.WidgetButton = openerp.web.form.Widget.extend({
}, },
on_confirmed: function() { on_confirmed: function() {
var self = this; var self = this;
var context = this.node.attrs.context; var context = this.node.attrs.context;
if (context && context.__ref) { if (context && context.__ref) {
context = new openerp.web.CompoundContext(context); context = new openerp.web.CompoundContext(context);
@ -2745,13 +2745,13 @@ openerp.web.form.FieldStatus = openerp.web.form.Field.extend({
start: function() { start: function() {
this._super(); this._super();
this.selected_value = null; this.selected_value = null;
this.render_list(); this.render_list();
}, },
set_value: function(value) { set_value: function(value) {
this._super(value); this._super(value);
this.selected_value = value; this.selected_value = value;
this.render_list(); this.render_list();
}, },
render_list: function() { render_list: function() {
@ -2759,7 +2759,7 @@ openerp.web.form.FieldStatus = openerp.web.form.Field.extend({
var shown = _.map(((this.node.attrs || {}).statusbar_visible || "").split(","), var shown = _.map(((this.node.attrs || {}).statusbar_visible || "").split(","),
function(x) { return _.trim(x); }); function(x) { return _.trim(x); });
shown = _.select(shown, function(x) { return x.length > 0; }); shown = _.select(shown, function(x) { return x.length > 0; });
if (shown.length == 0) { if (shown.length == 0) {
this.to_show = this.field.selection; this.to_show = this.field.selection;
} else { } else {
@ -2767,10 +2767,10 @@ openerp.web.form.FieldStatus = openerp.web.form.Field.extend({
return _.indexOf(shown, x[0]) !== -1 || x[0] === self.selected_value; return _.indexOf(shown, x[0]) !== -1 || x[0] === self.selected_value;
}); });
} }
var content = openerp.web.qweb.render("FieldStatus.content", {widget: this, _:_}); var content = openerp.web.qweb.render("FieldStatus.content", {widget: this, _:_});
this.$element.html(content); this.$element.html(content);
var colors = JSON.parse((this.node.attrs || {}).statusbar_colors || "{}"); var colors = JSON.parse((this.node.attrs || {}).statusbar_colors || "{}");
var color = colors[this.selected_value]; var color = colors[this.selected_value];
if (color) { if (color) {
@ -2872,6 +2872,7 @@ openerp.web.form.FieldSelectionReadonly = openerp.web.form.FieldReadonly.extend(
openerp.web.form.FieldMany2OneReadonly = openerp.web.form.FieldCharReadonly.extend({ openerp.web.form.FieldMany2OneReadonly = openerp.web.form.FieldCharReadonly.extend({
set_value: function (value) { set_value: function (value) {
value = value || null; value = value || null;
this._super(value);
this.invalid = false; this.invalid = false;
var self = this; var self = this;
this.tmp_value = value; this.tmp_value = value;