Add missing Reference widget in tree view

review17701002
This commit is contained in:
C?dric Krier 2015-12-31 13:43:15 +01:00
parent 2a5d676f11
commit a392640988

View file

@ -1560,6 +1560,8 @@
return Sao.View.EditableTree.Boolean;
case 'many2one':
return Sao.View.EditableTree.Many2One;
case 'reference':
return Sao.View.EditableTree.Reference;
case 'one2one':
return Sao.View.EditableTree.One2One;
case 'one2many':
@ -1674,6 +1676,23 @@
}
});
Sao.View.EditableTree.Reference = Sao.class_(Sao.View.Form.Reference, {
class_: 'editabletree-reference',
init: function(field_name, model, attributes) {
Sao.View.EditableTree.Reference._super.init.call(this, field_name,
model, attributes);
this.el.on('keydown', this.key_press.bind(this));
},
key_press: function(event_) {
if (event_.which == Sao.common.TAB_KEYCODE) {
this.focus_out();
} else {
Sao.View.EditableTree.Reference._super.key_press.call(this,
event_);
}
}
});
Sao.View.EditableTree.One2One = Sao.class_(Sao.View.Form.One2One, {
class_: 'editabletree-one2one',
init: function(field_name, model, attributes) {