diff --git a/erpnext/accounts/doctype/c_form/c_form.py b/erpnext/accounts/doctype/c_form/c_form.py index c14990ae73b..2dcf9585563 100644 --- a/erpnext/accounts/doctype/c_form/c_form.py +++ b/erpnext/accounts/doctype/c_form/c_form.py @@ -18,17 +18,17 @@ class CForm(Document): `tabSales Invoice` where name = %s and docstatus = 1""", d.invoice_no) if inv and inv[0][0] != 'Yes': - frappe.throw("C-form is not applicable for Invoice: {0}".format(d.invoice_no)) + frappe.throw(_("C-form is not applicable for Invoice: {0}".format(d.invoice_no))) elif inv and inv[0][1] and inv[0][1] != self.name: - frappe.throw("""Invoice {0} is tagged in another C-form: {1}. + frappe.throw(_("""Invoice {0} is tagged in another C-form: {1}. If you want to change C-form no for this invoice, please remove invoice no from the previous c-form and then try again"""\ - .format(d.invoice_no, inv[0][1])) + .format(d.invoice_no, inv[0][1]))) elif not inv: - frappe.throw("Row {0}: Invoice {1} is invalid, it might be cancelled / does not exist. \ - Please enter a valid Invoice".format(d.idx, d.invoice_no)) + frappe.throw(_("Row {0}: Invoice {1} is invalid, it might be cancelled / does not exist. \ + Please enter a valid Invoice".format(d.idx, d.invoice_no))) def on_update(self): """ Update C-Form No on invoices""" diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.py b/erpnext/accounts/doctype/gl_entry/gl_entry.py index 906c1313897..9505528fd24 100644 --- a/erpnext/accounts/doctype/gl_entry/gl_entry.py +++ b/erpnext/accounts/doctype/gl_entry/gl_entry.py @@ -41,7 +41,7 @@ class GLEntry(Document): mandatory = ['account','remarks','voucher_type','voucher_no','company'] for k in mandatory: if not self.get(k): - frappe.throw(_("{0} is required").format(self.meta.get_label(k))) + frappe.throw(_("{0} is required").format(_(self.meta.get_label(k)))) account_type = frappe.db.get_value("Account", self.account, "account_type") if account_type in ["Receivable", "Payable"] and not (self.party_type and self.party): diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index 74b749a0179..b667c549a3a 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -501,7 +501,7 @@ class JournalEntry(AccountsController): def validate_empty_accounts_table(self): if not self.get('accounts'): - frappe.throw("Accounts table cannot be blank.") + frappe.throw(_("Accounts table cannot be blank.")) def set_account_and_party_balance(self): account_balance = {} diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index 180831ee921..f95569dc6e6 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -429,7 +429,7 @@ class PurchaseInvoice(BuyingController): def validate_supplier_invoice(self): if self.bill_date: if getdate(self.bill_date) > getdate(self.posting_date): - frappe.throw("Supplier Invoice Date cannot be greater than Posting Date") + frappe.throw(_("Supplier Invoice Date cannot be greater than Posting Date")) if self.bill_no: if cint(frappe.db.get_single_value("Accounts Settings", "check_supplier_invoice_uniqueness")): @@ -449,7 +449,7 @@ class PurchaseInvoice(BuyingController): if pi: pi = pi[0][0] - frappe.throw("Supplier Invoice No exists in Purchase Invoice {0}".format(pi)) + frappe.throw(_("Supplier Invoice No exists in Purchase Invoice {0}".format(pi))) def update_billing_status_in_pr(self, update_modified=True): updated_pr = [] diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py index 0c8d999a985..62725d39f88 100644 --- a/erpnext/accounts/party.py +++ b/erpnext/accounts/party.py @@ -313,8 +313,8 @@ def validate_party_frozen_disabled(party_type, party_name): if party_type and party_name: party = frappe.db.get_value(party_type, party_name, ["is_frozen", "disabled"], as_dict=True) if party.disabled: - frappe.throw("{0} {1} is disabled".format(party_type, party_name), PartyDisabled) + frappe.throw(_("{0} {1} is disabled".format(party_type, party_name), PartyDisabled)) elif party.is_frozen: frozen_accounts_modifier = frappe.db.get_value( 'Accounts Settings', None,'frozen_accounts_modifier') if not frozen_accounts_modifier in frappe.get_roles(): - frappe.throw("{0} {1} is frozen".format(party_type, party_name), PartyFrozen) + frappe.throw(_("{0} {1} is frozen".format(party_type, party_name), PartyFrozen)) diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py index 04022c5fc29..2c58fd28f29 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.py +++ b/erpnext/manufacturing/doctype/production_order/production_order.py @@ -267,7 +267,7 @@ class ProductionOrder(Document): # if time log needs to be moved, make sure that the from time is not the same if _from_time == time_log.from_time: - frappe.throw("Capacity Planning Error") + frappe.throw(_("Capacity Planning Error")) d.planned_start_time = time_log.from_time d.planned_end_time = time_log.to_time diff --git a/erpnext/projects/doctype/time_log/time_log.py b/erpnext/projects/doctype/time_log/time_log.py index b2a855d00d9..1d523d98476 100644 --- a/erpnext/projects/doctype/time_log/time_log.py +++ b/erpnext/projects/doctype/time_log/time_log.py @@ -193,7 +193,7 @@ class TimeLog(Document): or self.get_overlap_for("user") if not overlapping: - frappe.throw("Logical error: Must find overlapping") + frappe.throw(_("Logical error: Must find overlapping")) self.from_time = get_datetime(overlapping.to_time) + get_mins_between_operations()