add toString method to frappe.user
This commit is contained in:
parent
e1b243996a
commit
dec7b337c6
1 changed files with 13 additions and 0 deletions
|
|
@ -141,6 +141,19 @@ $.extend(frappe.user, {
|
|||
quote: quote
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/* Normally frappe.user is an object
|
||||
* having properties and methods.
|
||||
* But in the following case
|
||||
*
|
||||
* if (frappe.user === 'Administrator')
|
||||
*
|
||||
* frappe.user will cast to a string
|
||||
* returning frappe.user.name
|
||||
*/
|
||||
toString: function() {
|
||||
return this.name;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue