forked from Techsystech/web
[ADD] hide the widget if the user has right on only one company. (following Arthru's remark)
parent
abc811e1c8
commit
50220e6cb2
|
@ -40,6 +40,11 @@ openerp.web_easy_switch_company = function (instance) {
|
|||
renderElement: function() {
|
||||
var self = this;
|
||||
this._super();
|
||||
if (this.companies.length === 1) {
|
||||
this.$el.hide();
|
||||
}
|
||||
else{
|
||||
this.$el.show();
|
||||
this.$el.find('.easy_switch_company_company_item').on('click', function(ev) {
|
||||
var company_id = $(ev.target).data("company-id");
|
||||
if (company_id != self.current_company_id){
|
||||
|
@ -50,6 +55,7 @@ openerp.web_easy_switch_company = function (instance) {
|
|||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/***********************************************************************
|
||||
|
|
Loading…
Reference in New Issue