Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions sao/src/sao.js
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,10 @@ var Sao = {

Sao.main_menu_row_activate = function() {
var screen = Sao.main_menu_screen;
if (Date.now() - Sao.last_menu_open < 150) {
return;
}
Sao.last_menu_open = Date.now();
// ids is not defined to prevent to add suffix
return Sao.Action.exec_keyword('tree_open', {
'model': screen.model_name,
Expand Down Expand Up @@ -833,6 +837,7 @@ var Sao = {
});
Sao.main_menu_screen = form.screen;
Sao.main_menu_screen.switch_callback = null;
Sao.last_menu_open = Date.now();
Sao.Tab.tabs.splice(Sao.Tab.tabs.indexOf(form), 1);
form.view_prm.done(function() {
var view = form.screen.current_view;
Expand Down
60 changes: 34 additions & 26 deletions sao/src/tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -793,33 +793,41 @@
}
button.data('disabled', true);
this.modified_save().then(function() {
var exec_action = jQuery.extend({}, qaction);
var record_id = null;
if (screen.current_record) {
record_id = screen.current_record.id;
}
var records, paths;
if (action.records == 'listed') {
records = screen.listed_records;
paths = screen.listed_paths;
} else {
records = screen.selected_records;
paths = screen.selected_paths;
try {
var exec_action = jQuery.extend({}, qaction);
var record_id = null;
if (screen.current_record) {
record_id = screen.current_record.id;
}
var records, paths;
if (action.records == 'listed') {
records = screen.listed_records;
paths = screen.listed_paths;
} else {
records = screen.selected_records;
paths = screen.selected_paths;
}
var record_ids = records.map(function(record) {
return record.id;
});
var model_context = screen.context_screen ?
screen.context_screen.model_name : null;
var data = {
'model': screen.model_name,
'model_context': model_context,
'id': record_id,
'ids': record_ids,
'paths': paths,
};
Sao.Action.execute(exec_action, data,
jQuery.extend({}, screen.local_context));
} finally {
button.data('disabled', false);
}
var record_ids = records.map(function(record) {
return record.id;
});
var model_context = screen.context_screen ?
screen.context_screen.model_name : null;
var data = {
'model': screen.model_name,
'model_context': model_context,
'id': record_id,
'ids': record_ids,
'paths': paths,
};
Sao.Action.execute(exec_action, data,
jQuery.extend({}, screen.local_context));
},
function(reason) {
button.data('disabled', false);
throw(reason);
});
});
});
Expand Down