[FIX] Issue with py.eval if no options passed.

bzr revid: vta@openerp.com-20121107104933-a60t27t1hjyu368f
This commit is contained in:
vta vta@openerp.com 2012-11-07 11:49:33 +01:00
parent 4b0d99d6c8
commit 064003797e
1 changed files with 4 additions and 1 deletions

View File

@ -3162,7 +3162,10 @@ instance.web.form.Many2OneButton = instance.web.form.AbstractField.extend({
if (this.$button) {
this.$button.remove();
}
var options =py.eval(this.node.attrs.options);
var options = {};
try {
options = py.eval(this.node.attrs.options);
} catch (e) {}
if (options.label) {
this.string = this.get('value') ? _t(options.label.edit) : _t(options.label.create);
} else {