mirror of
https://github.com/NaN-tic/sao-base.git
synced 2023-12-14 03:13:01 +01:00
Add missing Reference widget in tree view
review17701002
This commit is contained in:
parent
2a5d676f11
commit
a392640988
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue