109 lines
3.9 KiB
Diff
109 lines
3.9 KiB
Diff
diff --git a/tryton/sao/src/sao.js b/tryton/sao/src/sao.js
|
|
index f803f49f40..686ae2a6fe 100644
|
|
--- a/tryton/sao/src/sao.js
|
|
+++ b/tryton/sao/src/sao.js
|
|
@@ -778,11 +778,14 @@ var Sao = {
|
|
|
|
Sao.main_menu_row_activate = function() {
|
|
var screen = Sao.main_menu_screen;
|
|
- // ids is not defined to prevent to add suffix
|
|
- return Sao.Action.exec_keyword('tree_open', {
|
|
- 'model': screen.model_name,
|
|
- 'id': screen.get_id(),
|
|
- }, null, false);
|
|
+ const id = screen.get_id();
|
|
+ if (id) {
|
|
+ // ids is not defined to prevent to add suffix
|
|
+ Sao.Action.exec_keyword('tree_open', {
|
|
+ 'model': screen.model_name,
|
|
+ 'id': screen.get_id(),
|
|
+ }, null, false);
|
|
+ }
|
|
};
|
|
|
|
Sao.menu = function(preferences) {
|
|
@@ -824,6 +827,7 @@ var Sao = {
|
|
view.table.removeClass('table table-bordered');
|
|
view.table.addClass('no-responsive');
|
|
view.table.find('thead').hide();
|
|
+ view.table.find('colgroup > col.tree-menu').css('width', 0);
|
|
var gs = new Sao.GlobalSearch();
|
|
jQuery('#global-search').empty();
|
|
jQuery('#global-search').append(gs.el);
|
|
diff --git a/tryton/sao/src/sao.less b/tryton/sao/src/sao.less
|
|
index 46118c95ff..6cee9df988 100644
|
|
--- a/tryton/sao/src/sao.less
|
|
+++ b/tryton/sao/src/sao.less
|
|
@@ -451,11 +451,13 @@ img.icon {
|
|
}
|
|
|
|
td.draggable-handle, td.optional {
|
|
- cursor: grab;
|
|
> img {
|
|
.center-block();
|
|
}
|
|
}
|
|
+ td.draggable-handle {
|
|
+ cursor: grab;
|
|
+ }
|
|
th.selection-state, td.selection-state {
|
|
> input {
|
|
.center-block();
|
|
@@ -603,12 +605,13 @@ img.icon {
|
|
cursor: pointer;
|
|
> img {
|
|
float: left;
|
|
- margin-right: 5px;
|
|
+ margin-right: 1em;
|
|
[dir="rtl"] & {
|
|
float: right;
|
|
- margin-left: 5px;
|
|
+ margin-left: 1em;
|
|
}
|
|
- width: 1em;
|
|
+ width: unit(@line-height-base, em);
|
|
+ height: unit(@line-height-base, em);
|
|
}
|
|
}
|
|
label {
|
|
diff --git a/tryton/sao/src/screen.js b/tryton/sao/src/screen.js
|
|
index da51d8ffa1..1ffb0f5672 100644
|
|
--- a/tryton/sao/src/screen.js
|
|
+++ b/tryton/sao/src/screen.js
|
|
@@ -1476,11 +1476,14 @@
|
|
default_row_activate: function() {
|
|
if ((this.current_view.view_type == 'tree') &&
|
|
(this.current_view.attributes.keyword_open == 1)) {
|
|
- Sao.Action.exec_keyword('tree_open', {
|
|
- 'model': this.model_name,
|
|
- 'id': this.get_id(),
|
|
- 'ids': [this.get_id()]
|
|
- }, this.local_context, false);
|
|
+ const id = this.get_id();
|
|
+ if (id) {
|
|
+ Sao.Action.exec_keyword('tree_open', {
|
|
+ 'model': this.model_name,
|
|
+ 'id': this.get_id(),
|
|
+ 'ids': [this.get_id()]
|
|
+ }, this.local_context, false);
|
|
+ }
|
|
} else {
|
|
if (!this.modified()) {
|
|
this.switch_view('form');
|
|
diff --git a/tryton/sao/src/view/tree.js b/tryton/sao/src/view/tree.js
|
|
index 8d8c8b1685..e3f73178a3 100644
|
|
--- a/tryton/sao/src/view/tree.js
|
|
+++ b/tryton/sao/src/view/tree.js
|
|
@@ -1523,6 +1523,11 @@
|
|
this.expander.children().html(' ');
|
|
this.expander.on('click keypress',
|
|
Sao.common.click_press(this.toggle_row.bind(this)));
|
|
+ this.expander.dblclick((evt) => {
|
|
+ // prevent calling switch_row on td
|
|
+ evt.preventDefault();
|
|
+ evt.stopImmediatePropagation();
|
|
+ });
|
|
}
|
|
|
|
for (var i = 0; i < this.tree.columns.length; i++) {
|