diff --git a/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py b/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py
index cde8e8cdf1..b2c31ce377 100644
--- a/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py
+++ b/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py
@@ -61,7 +61,7 @@ class OpeningInvoiceCreationTool(Document):
def make_invoices(self):
names = []
- mandatory_error_msg = _("Row {idx}: {field} is required to create the Opening {invoice_type} Invoices")
+ mandatory_error_msg = _("Row {0}: {1} is required to create the Opening {2} Invoices")
if not self.company:
frappe.throw(_("Please select the Company"))
@@ -73,7 +73,7 @@ class OpeningInvoiceCreationTool(Document):
if not row.temporary_opening_account:
row.temporary_opening_account = get_temporary_opening_account(self.company)
row.party_type = "Customer" if self.invoice_type == "Sales" else "Supplier"
-
+
# Allow to create invoice even if no party present in customer or supplier.
if not frappe.db.exists(row.party_type, row.party):
if self.create_missing_party:
@@ -90,11 +90,7 @@ class OpeningInvoiceCreationTool(Document):
for d in ("Party", "Outstanding Amount", "Temporary Opening Account"):
if not row.get(scrub(d)):
- frappe.throw(mandatory_error_msg.format(
- idx=row.idx,
- field=_(d),
- invoice_type=self.invoice_type
- ))
+ frappe.throw(mandatory_error_msg.format(row.idx, _(d), self.invoice_type))
args = self.get_invoice_dict(row=row)
if not args:
@@ -128,7 +124,7 @@ class OpeningInvoiceCreationTool(Document):
party_doc.supplier_group = supplier_group
party_doc.flags.ignore_mandatory = True
- party_doc.save(ignore_permissions=True)
+ party_doc.save(ignore_permissions=True)
def get_invoice_dict(self, row=None):
def get_item_dict():
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index f6f9e4d74d..2deeebe70f 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -772,8 +772,7 @@ class AccountsController(TransactionBase):
if li:
duplicates = '
' + '
'.join(li)
- frappe.throw(_("Rows with duplicate due dates in other rows were found: {list}")
- .format(list=duplicates))
+ frappe.throw(_("Rows with duplicate due dates in other rows were found: {0}").format(duplicates))
def validate_payment_schedule_amount(self):
if self.doctype == 'Sales Invoice' and self.is_pos: return
diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py
index ad7d4b2d80..3671481682 100644
--- a/erpnext/controllers/buying_controller.py
+++ b/erpnext/controllers/buying_controller.py
@@ -753,8 +753,11 @@ def validate_item_type(doc, fieldname, message):
""".format(item_list, fieldname), as_list=True)]
if invalid_items:
- frappe.throw(_("Following item {items} {verb} marked as {message} item.\
- You can enable them as {message} item from its Item master".format(
- items = ", ".join([d for d in invalid_items]),
- verb = _("are not") if len(invalid_items) > 1 else _("is not"),
- message = message)))
+ items = ", ".join([d for d in invalid_items])
+
+ if len(invalid_items) > 1:
+ error_message = _("Following items {0} are not marked as {1} item. You can enable them as {1} item from its Item master".format(items, message))
+ else:
+ error_message = _("Following item {0} is not marked as {1} item. You can enable them as {1} item from its Item master".format(items, message))
+
+ frappe.throw(error_message)
diff --git a/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py b/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py
index a647717a41..2e1636ab43 100644
--- a/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py
+++ b/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py
@@ -60,8 +60,8 @@ class LandedCostVoucher(Document):
if not item.receipt_document:
frappe.throw(_("Item must be added using 'Get Items from Purchase Receipts' button"))
elif item.receipt_document not in receipt_documents:
- frappe.throw(_("Item Row {idx}: {doctype} {docname} does not exist in above '{doctype}' table")
- .format(idx=item.idx, doctype=item.receipt_document_type, docname=item.receipt_document))
+ frappe.throw(_("Item Row {0}: {1} {2} does not exist in above '{1}' table")
+ .format(item.idx, item.receipt_document_type, item.receipt_document))
if not item.cost_center:
frappe.throw(_("Row {0}: Cost center is required for an item {1}")