chore: mass trailing whitespace and EOF fixes

This commit is contained in:
Ankush Menat
2021-08-19 13:41:10 +05:30
parent 869e36c33a
commit 4551d7d602
1190 changed files with 1352 additions and 1604 deletions

View File

@@ -235,4 +235,3 @@ def _get_employee_from_user(user):
# frappe.db.exists returns a tuple of a tuple
return frappe.get_doc('Employee', employee_docname[0][0])
return None

View File

@@ -7,4 +7,4 @@ function check_times(frm) {
frappe.throw(__('In row {0} of Appointment Booking Slots: "To Time" must be later than "From Time".', [i + 1]));
}
});
}
}

View File

@@ -15,7 +15,7 @@ frappe.ui.form.on("Contract", {
let contract_template = r.message.contract_template;
frm.set_value("contract_terms", r.message.contract_terms);
frm.set_value("requires_fulfilment", contract_template.requires_fulfilment);
if (frm.doc.requires_fulfilment) {
// Populate the fulfilment terms table from a contract template, if any
r.message.contract_template.fulfilment_terms.forEach(element => {
@@ -23,7 +23,7 @@ frappe.ui.form.on("Contract", {
d.requirement = element.requirement;
});
frm.refresh_field("fulfilment_terms");
}
}
}
}
});

View File

@@ -9,4 +9,4 @@ frappe.listview_settings['Contract'] = {
return [__(doc.status), "gray", "status,=," + doc.status];
}
},
};
};

View File

@@ -24,8 +24,8 @@ def get_contract_template(template_name, doc):
if contract_template.contract_terms:
contract_terms = frappe.render_template(contract_template.contract_terms, doc)
return {
'contract_template': contract_template,
'contract_template': contract_template,
'contract_terms': contract_terms
}
}

View File

@@ -34,7 +34,7 @@ class Lead(SellingController):
"ends_on": frappe.db.get_value("Lead", self.name, "ends_on") if (not cint(self.is_new())) else None,
"contact_by": frappe.db.get_value("Lead", self.name, "contact_by") if (not cint(self.is_new())) else None,
})
def set_full_name(self):
self.lead_name = " ".join(filter(None, [self.first_name, self.middle_name, self.last_name]))

View File

@@ -16,4 +16,4 @@ def get_data():
'items': ['Opportunity', 'Quotation']
},
]
}
}

View File

@@ -82,4 +82,4 @@ def make_lead(**args):
"email_id": args.email_id or "new_lead_{}@example.com".format(random_string(5)),
}).insert()
return lead_doc
return lead_doc

View File

@@ -57,7 +57,7 @@ frappe.ui.form.on("Opportunity", {
if (frm.doc.status == "Lost"){
frm.trigger('set_as_lost_dialog');
}
},
customer_address: function(frm, cdt, cdn) {

View File

@@ -372,4 +372,4 @@ def get_events(start, end, filters=None):
"start": start,
"end": end
}, as_dict=True, update={"allDay": 0})
return data
return data

View File

@@ -9,4 +9,4 @@ def get_data():
'items': ['Quotation', 'Supplier Quotation']
},
]
}
}

View File

@@ -87,4 +87,4 @@ def make_opportunity(**args):
})
opp_doc.insert()
return opp_doc
return opp_doc

View File

@@ -19,7 +19,7 @@ frappe.ui.form.on('Social Media Post', {
refresh: function(frm){
if (frm.doc.docstatus === 1){
if (frm.doc.post_status != "Posted"){
add_post_btn(frm);
add_post_btn(frm);
}
else if (frm.doc.post_status == "Posted"){
frm.set_df_property('sheduled_time', 'read_only', 1);
@@ -63,5 +63,5 @@ var post = function(frm){
frappe.dom.unfreeze();
}
})
}
}

View File

@@ -16,4 +16,3 @@ frappe.query_reports["Campaign Efficiency"] = {
}
]
};

View File

@@ -132,4 +132,4 @@ def get_order_amount(leads):
where prevdoc_docname in (
select name from `tabQuotation` where status = 'Ordered'
and quotation_to = 'Lead' and party_name in (%s)
)""" % ', '.join(["%s"]*len(leads)), tuple(leads))[0][0]
)""" % ', '.join(["%s"]*len(leads)), tuple(leads))[0][0]

View File

@@ -20,5 +20,3 @@ frappe.query_reports["Lead Conversion Time"] = {
},
]
};

View File

@@ -49,4 +49,4 @@ frappe.query_reports["Lead Details"] = {
"options": "Territory",
}
]
};
};

View File

@@ -107,7 +107,7 @@ def get_columns():
"options": "Country",
"width": 100
},
]
return columns
@@ -142,7 +142,7 @@ def get_data(filters):
company = %(company)s
AND `tabLead`.creation BETWEEN %(from_date)s AND %(to_date)s
{conditions}
ORDER BY
ORDER BY
`tabLead`.creation asc """.format(conditions=get_conditions(filters)), filters, as_dict=1)
def get_conditions(filters) :
@@ -153,6 +153,5 @@ def get_conditions(filters) :
if filters.get("status"):
conditions.append(" and `tabLead`.status=%(status)s")
return " ".join(conditions) if conditions else ""
return " ".join(conditions) if conditions else ""

View File

@@ -64,4 +64,4 @@ frappe.query_reports["Lost Opportunity"] = {
"options": "User"
},
]
};
};

View File

@@ -87,17 +87,17 @@ def get_data(filters):
`tabOpportunity`.sales_stage,
`tabOpportunity`.territory
FROM
`tabOpportunity`
`tabOpportunity`
{join}
WHERE
`tabOpportunity`.status = 'Lost' and `tabOpportunity`.company = %(company)s
AND `tabOpportunity`.modified BETWEEN %(from_date)s AND %(to_date)s
{conditions}
GROUP BY
`tabOpportunity`.name
ORDER BY
AND `tabOpportunity`.modified BETWEEN %(from_date)s AND %(to_date)s
{conditions}
GROUP BY
`tabOpportunity`.name
ORDER BY
`tabOpportunity`.creation asc """.format(conditions=get_conditions(filters), join=get_join(filters)), filters, as_dict=1)
def get_conditions(filters):
conditions = []
@@ -117,15 +117,15 @@ def get_conditions(filters):
return " ".join(conditions) if conditions else ""
def get_join(filters):
join = """LEFT JOIN `tabOpportunity Lost Reason Detail`
ON `tabOpportunity Lost Reason Detail`.parenttype = 'Opportunity' and
join = """LEFT JOIN `tabOpportunity Lost Reason Detail`
ON `tabOpportunity Lost Reason Detail`.parenttype = 'Opportunity' and
`tabOpportunity Lost Reason Detail`.parent = `tabOpportunity`.name"""
if filters.get("lost_reason"):
join = """JOIN `tabOpportunity Lost Reason Detail`
ON `tabOpportunity Lost Reason Detail`.parenttype = 'Opportunity' and
join = """JOIN `tabOpportunity Lost Reason Detail`
ON `tabOpportunity Lost Reason Detail`.parenttype = 'Opportunity' and
`tabOpportunity Lost Reason Detail`.parent = `tabOpportunity`.name and
`tabOpportunity Lost Reason Detail`.lost_reason = '{0}'
""".format(filters.get("lost_reason"))
return join
return join

View File

@@ -106,4 +106,4 @@ def get_lead_filters(filters):
return lead_filters
def get_creation_date_based_on_lead_age(filters):
return add_days(now(), (filters.get('lead_age') * -1))
return add_days(now(), (filters.get('lead_age') * -1))