[FIX] Should not print workflow in non standard views

bzr revid: jam@tinyerp.com-20120912131951-6virlw8v8a8mccov
This commit is contained in:
Jigar Amin - OpenERP 2012-09-12 18:49:51 +05:30
parent ac2608d3dd
commit 14ed53e196
1 changed files with 6 additions and 2 deletions

View File

@ -837,8 +837,12 @@ instance.web.ViewManagerAction = instance.web.ViewManager.extend({
});
break;
case 'print_workflow':
var self = this
if (current_view.get_selected_ids().length != 1) {
var self = this;
if (self.active_view !== "form" && self.active_view !== "list"){
instance.web.dialog($("<div />").text(_t("Workflow can be printed from 'Form' or 'List' view only.")), { title: _t("Warning"), modal: true });
evt.currentTarget.selectedIndex = 0;
return false;
}else if (current_view.get_selected_ids().length != 1) {
instance.web.dialog($("<div />").text(_t("You must choose only one record.")), { title: _t("Warning"), modal: true });
evt.currentTarget.selectedIndex = 0;
return false;