Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: whitespace cleanup from codebase #27023

Merged
merged 2 commits into from
Aug 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@

# This commit just changes spaces to tabs for indentation in some files
5f473611bd6ed57703716244a054d3fb5ba9cd23

# Whitespace fix throughout codebase
4551d7d6029b6f587f6c99d4f8df5519241c6a86
2 changes: 1 addition & 1 deletion erpnext/.stylelintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
"scss/at-rule-no-unknown": true,
"no-descending-specificity": null
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ frappe.dashboards.chart_sources["Account Balance Timeline"] = {
reqd: 1
},
]
};
};
2 changes: 0 additions & 2 deletions erpnext/accounts/deferred_revenue.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,5 +450,3 @@ def get_deferred_booking_accounts(doctype, voucher_detail_no, dr_or_cr):
return debit_account
else:
return credit_account


Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ frappe.ui.form.on('Accounting Dimension Detail', {
let row = locals[cdt][cdn];
row.reference_document = frm.doc.document_type;
}
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,3 @@ def disable_dimension():
dimension2 = frappe.get_doc("Accounting Dimension", "Location")
dimension2.disabled = 1
dimension2.save()


Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ frappe.ui.form.on('Allowed Dimension', {
row.accounting_dimension = frm.doc.accounting_dimension;
frm.refresh_field("dimensions");
}
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ def bootstrap_doctypes_for_closing(self):
self.append('closed_documents', {
"document_type": doctype_for_closing.document_type,
"closed": doctype_for_closing.closed
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ frappe.tour['Accounts Settings'] = [
title: "Unlink Advance Payment on Cancellation of Order",
description: __("Similar to the previous option, this unlinks any advance payments made against Purchase/Sales Orders.")
}
];
];
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def enable_payment_schedule_in_print(self):

def toggle_discount_accounting_fields(self):
enable_discount_accounting = cint(self.enable_discount_accounting)

for doctype in ["Sales Invoice Item", "Purchase Invoice Item"]:
make_property_setter(doctype, "discount_account", "hidden", not(enable_discount_accounting), "Check", validate_fields_for_doctype=False)
if enable_discount_accounting:
Expand All @@ -52,4 +52,4 @@ def toggle_discount_accounting_fields(self):
else:
make_property_setter(doctype, "additional_discount_account", "mandatory_depends_on", "", "Code", validate_fields_for_doctype=False)

make_property_setter("Item", "default_discount_account", "hidden", not(enable_discount_accounting), "Check", validate_fields_for_doctype=False)
make_property_setter("Item", "default_discount_account", "hidden", not(enable_discount_accounting), "Check", validate_fields_for_doctype=False)
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ frappe.ui.form.on('Accounts Settings', {
frm.set_df_property("frozen_accounts_modifier", "label", "Role Allowed to Close Books & Make Changes to Closed Periods");
frm.set_df_property("credit_controller", "label", "Credit Manager");
}
});
});
2 changes: 1 addition & 1 deletion erpnext/accounts/doctype/bank/bank.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,4 @@ erpnext.integrations.refreshPlaidLink = class refreshPlaidLink {
plaid_success(token, response) {
frappe.show_alert({ message: __('Plaid Link Updated'), indicator: 'green' });
}
};
};
2 changes: 1 addition & 1 deletion erpnext/accounts/doctype/bank/bank.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ def onload(self):
load_address_and_contact(self)

def on_trash(self):
delete_contact_and_address('Bank', self.name)
delete_contact_and_address('Bank', self.name)
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ def get_data():
'items': ['Journal Entry']
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ frappe.ui.form.on("Bank Clearance", {

onload: function(frm) {

let default_bank_account = frappe.defaults.get_user_default("Company")?
let default_bank_account = frappe.defaults.get_user_default("Company")?
locals[":Company"][frappe.defaults.get_user_default("Company")]["default_bank_account"]: "";
frm.set_value("account", default_bank_account);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
from frappe.model.document import Document

class BankClearanceDetail(Document):
pass
pass
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ def on_submit(self):
def get_vouchar_detials(column_list, doctype, docname):
column_list = json.loads(column_list)
for col in column_list:
sanitize_searchfield(col)
sanitize_searchfield(col)
return frappe.db.sql(''' select {columns} from `tab{doctype}` where name=%s'''
.format(columns=", ".join(column_list), doctype=doctype), docname, as_dict=1)[0]
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,3 @@ def unclear_reference_payment(doctype, docname):
frappe.db.set_value(doc.payment_document, doc.payment_entry, "clearance_date", None)

return doc.payment_entry

Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ frappe.listview_settings['Bank Transaction'] = {
return [__("Reconciled"), "green", "unallocated_amount,=,0"];
}
}
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ def get_bank_mapping(bank_account):

mapping = {row.file_field:row.bank_transaction_field for row in bank.bank_transaction_mapping}

return mapping
return mapping
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
from frappe.model.document import Document

class CFormInvoiceDetail(Document):
pass
pass
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,3 @@ def validate_checked_options(self):
frappe._('You can only select a maximum of one option from the list of check boxes.'),
title='Error'
)


Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ def make_calculations(self):

def validate_time(self):
if self.from_time >= self.time:
frappe.throw(_("From Time Should Be Less Than To Time"))
frappe.throw(_("From Time Should Be Less Than To Time"))
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ frappe.ui.form.on('Cheque Print Template', {
function() {
erpnext.cheque_print.view_cheque_print(frm);
}).addClass("btn-primary");

$(frm.fields_dict.cheque_print_preview.wrapper).empty()


var template = '<div style="position: relative; overflow-x: scroll;">\
<div id="cheque_preview" style="width: {{ cheque_width }}cm; \
height: {{ cheque_height }}cm;\
Expand Down Expand Up @@ -47,9 +47,9 @@ frappe.ui.form.on('Cheque Print Template', {
position: absolute;"> Signatory Name </span>\
</div>\
</div>';

$(frappe.render(template, frm.doc)).appendTo(frm.fields_dict.cheque_print_preview.wrapper)

if (frm.doc.scanned_cheque) {
$(frm.fields_dict.cheque_print_preview.wrapper).find("#cheque_preview").css('background-image', 'url(' + frm.doc.scanned_cheque + ')');
}
Expand Down
2 changes: 1 addition & 1 deletion erpnext/accounts/doctype/cost_center/cost_center.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,4 @@ def get_name_with_number(new_account, account_number):

def check_if_distributed_cost_center_enabled(cost_center_list):
value_list = frappe.get_list("Cost Center", {"name": ["in", cost_center_list]}, "enable_distributed_cost_center", as_list=1)
return next((True for x in value_list if x[0]), False)
return next((True for x in value_list if x[0]), False)
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ def get_data():
'items': ['Budget Variance Report', 'General Ledger']
}
]
}
}
2 changes: 1 addition & 1 deletion erpnext/accounts/doctype/cost_center/cost_center_tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ frappe.treeview_settings["Cost Center"] = {

}

}
}
3 changes: 0 additions & 3 deletions erpnext/accounts/doctype/cost_center/test_cost_center.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,3 @@ def create_cost_center(**args):
cc.is_group = args.is_group or 0
cc.parent_cost_center = args.parent_cost_center or "_Test Company - _TC"
cc.insert()



2 changes: 1 addition & 1 deletion erpnext/accounts/doctype/coupon_code/coupon_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def autoname(self):
self.coupon_code =''.join(i for i in self.coupon_name if not i.isdigit())[0:8].upper()
elif self.coupon_type == "Gift Card":
self.coupon_code = frappe.generate_hash()[:10].upper()

def validate(self):
if self.coupon_type == "Gift Card":
self.maximum_use = 1
Expand Down
3 changes: 0 additions & 3 deletions erpnext/accounts/doctype/coupon_code/test_coupon_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,3 @@ def test_sales_order_with_coupon_code(self):

so.submit()
self.assertEqual(frappe.db.get_value("Coupon Code", "SAVE30", "used"), 1)



Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
from frappe.model.document import Document

class DiscountedInvoice(Document):
pass
pass
2 changes: 1 addition & 1 deletion erpnext/accounts/doctype/dunning/dunning_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ def get_data():
'items': ['Payment Entry', 'Journal Entry']
}
]
}
}
2 changes: 1 addition & 1 deletion erpnext/accounts/doctype/dunning/test_dunning.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,4 @@ def create_dunning_type_with_zero_interest_rate():
'closing_text': 'We kindly request that you pay the outstanding amount immediately, and late fees.'
}
)
dunning_type.save()
dunning_type.save()
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ frappe.ui.form.on('Exchange Rate Revaluation', {
}, __('Create'));
}
}
});
});
}
},

Expand Down Expand Up @@ -128,4 +128,4 @@ var get_account_details = function(frm, cdt, cdn) {
frm.events.get_total_gain_loss(frm);
}
});
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def check_journal_entry_condition(self):

if total_amt != total_debit:
return True

return False

@frappe.whitelist()
Expand Down Expand Up @@ -205,4 +205,4 @@ def get_account_details(account, company, posting_date, party_type=None, party=N
"new_balance_in_base_currency": new_balance_in_base_currency
}

return account_details
return account_details
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def create_finance_book(self):
finance_book = frappe.get_doc("Finance Book", "_Test Finance Book")

return finance_book

def test_finance_book(self):
finance_book = self.create_finance_book()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ def get_data():
'items': ['Payment Entry', 'Journal Entry']
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ frappe.listview_settings['Invoice Discounting'] = {
return [__("Canceled"), "red", "status,=,Canceled"];
}
}
};
};
2 changes: 1 addition & 1 deletion erpnext/accounts/doctype/journal_entry/regional/india.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ frappe.ui.form.on("Journal Entry", {
};
});
}
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def test_jv_against_stock_account(self):
"debit_in_account_currency": 0 if diff > 0 else abs(diff),
"credit_in_account_currency": diff if diff > 0 else 0
})

jv.append("accounts", {
"account": "Stock Adjustment - TCP1",
"cost_center": "Main - TCP1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ frappe.ui.form.on("Journal Entry Template", {
frappe.model.clear_table(frm.doc, "accounts");
frm.refresh_field("accounts");
}
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ frappe.ui.form.on('Mode of Payment', {
};
});
},
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,3 @@ def validate_pos_mode_of_payment(self):
message = "POS Profile " + frappe.bold(", ".join(pos_profiles)) + " contains \
Mode of Payment " + frappe.bold(str(self.name)) + ". Please remove them to disable this mode."
frappe.throw(_(message), title="Not Allowed")

Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ def get_percentage(doc, start_date, period):
if d.month in months:
percentage += d.percentage_allocation

return percentage
return percentage
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ def get_data():
'items': ['Budget']
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,4 @@ frappe.ui.form.on('Opening Invoice Creation Tool Item', {
invoices_add: (frm) => {
frm.trigger('update_invoice_table');
}
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -241,4 +241,3 @@ def get_temporary_opening_account(company=None):
frappe.throw(_("Please add a Temporary Opening account in Chart of Accounts"))

return accounts[0].name

Loading