[fix] some bugs due to on_change and validation

bzr revid: nicolas.vanhoren@openerp.com-20110610152413-gnvtcamfg6d04z0j
This commit is contained in:
niv-openerp 2011-06-10 17:24:13 +02:00
parent 53af21f065
commit 12f8994d69
2 changed files with 4 additions and 4 deletions

View File

@ -1143,12 +1143,12 @@ openerp.base.form.FieldMany2One = openerp.base.form.Field.extend({
if (self.value === undefined) {
values.push({label: '<em>   Create "<strong>' +
$('<span />').text(search_val).html() + '</strong>"</em>', action: function() {
this._change_int_value(null);
self._change_int_value(null);
self._search_create_popup("form");
}});
}
values.push({label: "<em>   Create and Edit...</em>", action: function() {
this._change_int_value(null);
self._change_int_value(null);
self._search_create_popup("form");
}});
@ -1163,7 +1163,7 @@ openerp.base.form.FieldMany2One = openerp.base.form.Field.extend({
pop.select_element(self.field.relation, ids ? _.map(ids, function(x) {return x[0]}) : undefined, view);
pop.on_select_element.add(function(element_id) {
dataset.call("name_get", [element_id], function(data) {
this._change_int_ext_value(data.result);
self._change_int_ext_value(data.result[0]);
pop.stop();
});
});

View File

@ -530,7 +530,7 @@
<span class="oe-m2o-drop-down-button" t-att-id="widget.element_id + '_drop_down'">
<img src="/base/static/src/img/down-arrow.png" /></span>
<span class="oe-m2o-cm-button" t-att-id="widget.name + '_open'">
<img src="/base/static/src/img/icons/gtk-edit.png"/></span>
<img src="/base/static/src/img/icons/gtk-index.png"/></span>
<div t-att-id="widget.cm_id" class="contextMenu" style="display:none"><ul>
<li t-att-id="widget.cm_id + '_search'">Search</li>
<li t-att-id="widget.cm_id + '_create'">Create New</li>