fix: codacy
This commit is contained in:
parent
eae67eb0dd
commit
f6b4fdef0c
1 changed files with 8 additions and 8 deletions
|
|
@ -368,28 +368,28 @@ frappe.ui.filter_utils = {
|
|||
get_selected_value(field, condition) {
|
||||
let val = field.get_value();
|
||||
|
||||
if(typeof val==='string') {
|
||||
if (typeof val === 'string') {
|
||||
val = strip(val);
|
||||
}
|
||||
|
||||
if(condition == 'is' && !val) {
|
||||
if (condition == 'is' && !val) {
|
||||
val = field.df.options[0].value;
|
||||
}
|
||||
|
||||
if(field.df.original_type == 'Check') {
|
||||
if (field.df.original_type == 'Check') {
|
||||
val = (val=='Yes' ? 1 :0);
|
||||
}
|
||||
|
||||
if(condition.indexOf('like', 'not like')!==-1) {
|
||||
if (condition.indexOf('like', 'not like') !== -1) {
|
||||
// automatically append wildcards
|
||||
if(val && !(val.startsWith('%') || val.endsWith('%'))) {
|
||||
if (val && !(val.startsWith('%') || val.endsWith('%'))) {
|
||||
val = '%' + val + '%';
|
||||
}
|
||||
} else if(in_list(["in", "not in"], condition)) {
|
||||
if(val) {
|
||||
} else if (in_list(["in", "not in"], condition)) {
|
||||
if (val) {
|
||||
val = val.split(',').map(v => strip(v));
|
||||
}
|
||||
} if(val === '%') {
|
||||
} if (val === '%') {
|
||||
val = "";
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue