chore: whitespace cleanup from codebase

This commit is contained in:
Ankush Menat
2021-08-19 14:33:03 +05:30
parent e536f6d13f
commit 9bb69e711a
1218 changed files with 1391 additions and 1643 deletions

View File

@@ -55,4 +55,3 @@ def get_default_energy_point_rules():
'points': rule.get('points'),
'user_field': rule.get('user_field') or 'owner'
} for doctype, rule in doctype_rule_map.items()]

View File

@@ -24,4 +24,3 @@ def get_default_success_action():
'first_success_message': get_first_success_message(doctype),
'next_actions': 'new\nprint\nemail'
} for doctype in doctype_list]

View File

@@ -1,13 +1,13 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
//--------- ONLOAD -------------
cur_frm.cscript.onload = function(doc, cdt, cdn) {
}
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
}
}

View File

@@ -21,4 +21,4 @@ def get_brand_defaults(item, company):
row.pop("name")
return row
return frappe._dict()
return frappe._dict()

View File

@@ -4,4 +4,4 @@ from __future__ import unicode_literals
import frappe
test_records = frappe.get_test_records('Brand')
test_records = frappe.get_test_records('Brand')

View File

@@ -313,4 +313,3 @@ var disbale_coa_fields = function(frm, bool=true) {
frm.set_df_property("chart_of_accounts", "read_only", bool);
frm.set_df_property("existing_company", "read_only", bool);
}

View File

@@ -108,7 +108,7 @@ class Company(NestedSet):
frappe.flags.country_change = True
self.create_default_accounts()
self.create_default_warehouses()
if not frappe.db.get_value("Cost Center", {"is_group": 0, "company": self.name}):
self.create_default_cost_center()

View File

@@ -37,4 +37,4 @@ def get_data():
'items': ['Project']
}
]
}
}

View File

@@ -30,4 +30,4 @@ frappe.treeview_settings["Company"] = {
onload: function(treeview) {
treeview.make_tree();
}
};
};

View File

@@ -130,4 +130,3 @@ def create_test_lead_in_company(company):
lead.company = company
lead.save()
return lead.name

View File

@@ -22,4 +22,4 @@ QUnit.test("Test: Company [SetUp]", function (assert) {
'chart of cost centers created'),
() => done()
]);
});
});

View File

@@ -16,4 +16,4 @@ QUnit.test("Test: Company", function (assert) {
() => done()
]);
});
});

View File

@@ -7,24 +7,24 @@ $.extend(cur_frm.cscript, {
cur_frm.set_value("to_currency", frappe.defaults.get_global_default("currency"));
}
},
refresh: function() {
cur_frm.cscript.set_exchange_rate_label();
},
from_currency: function() {
cur_frm.cscript.set_exchange_rate_label();
},
to_currency: function() {
cur_frm.cscript.set_exchange_rate_label();
},
set_exchange_rate_label: function() {
if(cur_frm.doc.from_currency && cur_frm.doc.to_currency) {
var default_label = __(frappe.meta.docfield_map[cur_frm.doctype]["exchange_rate"].label);
cur_frm.fields_dict.exchange_rate.set_label(default_label +
cur_frm.fields_dict.exchange_rate.set_label(default_label +
repl(" (1 %(from_currency)s = [?] %(to_currency)s)", cur_frm.doc));
}
}
});
});

View File

@@ -62,7 +62,7 @@ class TestCurrencyExchange(unittest.TestCase):
exchange_rate = get_exchange_rate("USD", "INR", "2016-01-30", "for_selling")
self.assertEqual(exchange_rate, 62.9)
# Exchange rate as on 15th Dec, 2015, should be fetched from fixer.io
self.clear_cache()
exchange_rate = get_exchange_rate("USD", "INR", "2015-12-15", "for_selling")

View File

@@ -30,4 +30,4 @@ def get_parent_customer_groups(customer_group):
order by lft asc""", (lft, rgt), as_dict=True)
def on_doctype_update():
frappe.db.add_index("Customer Group", ["lft", "rgt"])
frappe.db.add_index("Customer Group", ["lft", "rgt"])

View File

@@ -1,3 +1,3 @@
frappe.treeview_settings["Customer Group"] = {
ignore_fields:["parent_customer_group"]
}
}

View File

@@ -7,4 +7,4 @@ test_ignore = ["Price List"]
import frappe
test_records = frappe.get_test_records('Customer Group')
test_records = frappe.get_test_records('Customer Group')

View File

@@ -28,4 +28,4 @@ frappe.ui.form.on("Email Digest", {
});
}
}
});
});

View File

@@ -32,4 +32,3 @@ def get_random_quote():
]
return random.choice(quotes)

View File

@@ -180,8 +180,8 @@
<br>
</div>
{% endif %}
<!-- Purchase Order Items Overdue -->
<!-- Purchase Order Items Overdue -->
{% if purchase_orders_items_overdue_list %}
<h4 style="{{ section_head }}" class="text-center">{{ _("Purchase Order Items not received on time") }}</h4>
<div>
@@ -254,6 +254,6 @@
<div class="text-center">
<br><br><span class="text-danger">Please take necessary action</span>
</div>
{% endif %}
{% endif %}
</div>

View File

@@ -1,3 +1,3 @@
frappe.treeview_settings["Item Group"] = {
ignore_fields:["parent_item_group"]
}
}

View File

@@ -1,13 +1,13 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
//--------- ONLOAD -------------
cur_frm.cscript.onload = function(doc, cdt, cdn) {
}
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
}
}

View File

@@ -7,4 +7,4 @@ import frappe
from frappe.model.document import Document
class PrintHeading(Document):
pass
pass

View File

@@ -4,4 +4,4 @@ from __future__ import unicode_literals
import frappe
test_records = frappe.get_test_records('Print Heading')
test_records = frappe.get_test_records('Print Heading')

View File

@@ -1,13 +1,13 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
//--------- ONLOAD -------------
cur_frm.cscript.onload = function(doc, cdt, cdn) {
}
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
}
}

View File

@@ -7,4 +7,4 @@ import frappe
from frappe.model.document import Document
class QuotationLostReason(Document):
pass
pass

View File

@@ -4,4 +4,4 @@ from __future__ import unicode_literals
import frappe
test_records = frappe.get_test_records('Quotation Lost Reason')
test_records = frappe.get_test_records('Quotation Lost Reason')

View File

@@ -12,4 +12,4 @@ def get_data():
'items': ['Sales Order', 'Delivery Note', 'Sales Invoice']
},
]
}
}

View File

@@ -9,4 +9,4 @@ frappe.treeview_settings["Sales Person"] = {
{fieldtype:'Check', fieldname:'is_group', label:__('Group Node'),
description: __("Further nodes can be only created under 'Group' type nodes")}
],
}
}

View File

@@ -1,4 +1,4 @@
frappe.treeview_settings["Supplier Group"] = {
breadcrumbs: "Buying",
ignore_fields:["parent_supplier_group"]
};
};

View File

@@ -7,4 +7,4 @@ import frappe
from frappe.model.document import Document
class TargetDetail(Document):
pass
pass

View File

@@ -1,13 +1,13 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
//--------- ONLOAD -------------
cur_frm.cscript.onload = function(doc, cdt, cdn) {
}
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
}
}

View File

@@ -24,6 +24,6 @@ def get_terms_and_conditions(template_name, doc):
doc = json.loads(doc)
terms_and_conditions = frappe.get_doc("Terms and Conditions", template_name)
if terms_and_conditions.terms:
return frappe.render_template(terms_and_conditions.terms, doc)
return frappe.render_template(terms_and_conditions.terms, doc)

View File

@@ -36,4 +36,4 @@ cur_frm.fields_dict['parent_territory'].get_query = function(doc,cdt,cdn) {
['Territory', 'name', '!=', doc.territory_name]
]
}
}
}

View File

@@ -24,4 +24,4 @@ class Territory(NestedSet):
self.validate_one_root()
def on_doctype_update():
frappe.db.add_index("Territory", ["lft", "rgt"])
frappe.db.add_index("Territory", ["lft", "rgt"])

View File

@@ -1,3 +1,3 @@
frappe.treeview_settings["Territory"] = {
ignore_fields:["parent_territory"]
}
}

View File

@@ -23,7 +23,7 @@ class TestTransactionDeletionRecord(unittest.TestCase):
contains_company = True
break
self.assertTrue(contains_company)
def test_no_of_docs_is_correct(self):
for i in range(5):
create_task('Dunder Mifflin Paper Co')
@@ -40,13 +40,13 @@ class TestTransactionDeletionRecord(unittest.TestCase):
'company' : 'Dunder Mifflin Paper Co'
})
self.assertEqual(tasks_containing_company, [])
def create_company(company_name):
company = frappe.get_doc({
'doctype': 'Company',
'company_name': company_name,
'default_currency': 'INR'
})
})
company.insert(ignore_if_duplicate = True)
def create_transaction_deletion_request(company):

View File

@@ -4,7 +4,7 @@
frappe.ui.form.on('Transaction Deletion Record', {
onload: function(frm) {
if (frm.doc.docstatus == 0) {
let doctypes_to_be_ignored_array;
let doctypes_to_be_ignored_array;
frappe.call({
method: 'erpnext.setup.doctype.transaction_deletion_record.transaction_deletion_record.get_doctypes_to_be_ignored',
callback: function(r) {
@@ -25,15 +25,15 @@ frappe.ui.form.on('Transaction Deletion Record', {
frm.fields_dict['doctypes_to_be_ignored'].grid.set_column_disp('no_of_docs', false);
frm.refresh_field('doctypes_to_be_ignored');
}
});
function populate_doctypes_to_be_ignored(doctypes_to_be_ignored_array, frm) {
if (!(frm.doc.doctypes_to_be_ignored)) {
var i;
for (i = 0; i < doctypes_to_be_ignored_array.length; i++) {
for (i = 0; i < doctypes_to_be_ignored_array.length; i++) {
frm.add_child('doctypes_to_be_ignored', {
doctype_name: doctypes_to_be_ignored_array[i]
doctype_name: doctypes_to_be_ignored_array[i]
});
}
}

View File

@@ -31,7 +31,7 @@ class TransactionDeletionRecord(Document):
clear_notifications()
self.delete_company_transactions()
def populate_doctypes_to_be_ignored_table(self):
def populate_doctypes_to_be_ignored_table(self):
doctypes_to_be_ignored_list = get_doctypes_to_be_ignored()
for doctype in doctypes_to_be_ignored_list:
self.append('doctypes_to_be_ignored', {
@@ -74,7 +74,7 @@ class TransactionDeletionRecord(Document):
doctypes_to_be_ignored_list = self.get_doctypes_to_be_ignored_list()
docfields = self.get_doctypes_with_company_field(doctypes_to_be_ignored_list)
tables = self.get_all_child_doctypes()
tables = self.get_all_child_doctypes()
for docfield in docfields:
if docfield['parent'] != self.doctype:
no_of_docs = self.get_number_of_docs_linked_with_specified_company(docfield['parent'], docfield['fieldname'])
@@ -90,7 +90,7 @@ class TransactionDeletionRecord(Document):
naming_series = frappe.db.get_value('DocType', docfield['parent'], 'autoname')
if naming_series:
if '#' in naming_series:
self.update_naming_series(naming_series, docfield['parent'])
self.update_naming_series(naming_series, docfield['parent'])
def get_doctypes_to_be_ignored_list(self):
singles = frappe.get_all('DocType', filters = {'issingle': 1}, pluck = 'name')
@@ -101,9 +101,9 @@ class TransactionDeletionRecord(Document):
return doctypes_to_be_ignored_list
def get_doctypes_with_company_field(self, doctypes_to_be_ignored_list):
docfields = frappe.get_all('DocField',
docfields = frappe.get_all('DocField',
filters = {
'fieldtype': 'Link',
'fieldtype': 'Link',
'options': 'Company',
'parent': ['not in', doctypes_to_be_ignored_list]},
fields=['parent', 'fieldname'])
@@ -121,7 +121,7 @@ class TransactionDeletionRecord(Document):
self.append('doctypes', {
'doctype_name' : doctype,
'no_of_docs' : no_of_docs
})
})
def delete_child_tables(self, doctype, company_fieldname):
parent_docs_to_be_deleted = frappe.get_all(doctype, {
@@ -129,7 +129,7 @@ class TransactionDeletionRecord(Document):
}, pluck = 'name')
child_tables = frappe.get_all('DocField', filters = {
'fieldtype': 'Table',
'fieldtype': 'Table',
'parent': doctype
}, pluck = 'options')

View File

@@ -9,4 +9,4 @@ frappe.listview_settings['Transaction Deletion Record'] = {
return [__("Completed"), "green"];
}
}
};
};

View File

@@ -1,13 +1,13 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
//--------- ONLOAD -------------
cur_frm.cscript.onload = function(doc, cdt, cdn) {
}
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
}
}

View File

@@ -7,4 +7,4 @@ import frappe
from frappe.model.document import Document
class UOM(Document):
pass
pass

View File

@@ -9,4 +9,4 @@ import frappe
from frappe.model.document import Document
class WebsiteItemGroup(Document):
pass
pass

View File

@@ -173,4 +173,4 @@ def test_sample():
frappe.db.sql('delete from tabProject')
frappe.db.sql('delete from tabTask')
make_projects('Education')
import_notification()
import_notification()

View File

@@ -145,7 +145,7 @@ def make_taxes_and_charges_template(company_name, doctype, template):
doc = frappe.get_doc(template)
# Data in country wise json is already pre validated, hence validations can be ignored
# Data in country wise json is already pre validated, hence validations can be ignored
# Ingone validations to make doctypes faster
doc.flags.ignore_links = True
doc.flags.ignore_validate = True
@@ -177,7 +177,7 @@ def make_item_tax_template(company_name, template):
doc = frappe.get_doc(template)
# Data in country wise json is already pre validated, hence validations can be ignored
# Data in country wise json is already pre validated, hence validations can be ignored
# Ingone validations to make doctypes faster
doc.flags.ignore_links = True
doc.flags.ignore_validate = True