Fixes Translations

This commit is contained in:
Neil Trini Lasrado 2016-03-23 19:04:30 +05:30
parent d5bf8253da
commit b6d9946854
7 changed files with 13 additions and 13 deletions

View File

@ -18,17 +18,17 @@ class CForm(Document):
`tabSales Invoice` where name = %s and docstatus = 1""", d.invoice_no) `tabSales Invoice` where name = %s and docstatus = 1""", d.invoice_no)
if inv and inv[0][0] != 'Yes': 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: 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, If you want to change C-form no for this invoice,
please remove invoice no from the previous c-form and then try again"""\ 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: elif not inv:
frappe.throw("Row {0}: Invoice {1} is invalid, it might be cancelled / does not exist. \ 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)) Please enter a valid Invoice".format(d.idx, d.invoice_no)))
def on_update(self): def on_update(self):
""" Update C-Form No on invoices""" """ Update C-Form No on invoices"""

View File

@ -41,7 +41,7 @@ class GLEntry(Document):
mandatory = ['account','remarks','voucher_type','voucher_no','company'] mandatory = ['account','remarks','voucher_type','voucher_no','company']
for k in mandatory: for k in mandatory:
if not self.get(k): 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") 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): if account_type in ["Receivable", "Payable"] and not (self.party_type and self.party):

View File

@ -501,7 +501,7 @@ class JournalEntry(AccountsController):
def validate_empty_accounts_table(self): def validate_empty_accounts_table(self):
if not self.get('accounts'): 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): def set_account_and_party_balance(self):
account_balance = {} account_balance = {}

View File

@ -429,7 +429,7 @@ class PurchaseInvoice(BuyingController):
def validate_supplier_invoice(self): def validate_supplier_invoice(self):
if self.bill_date: if self.bill_date:
if getdate(self.bill_date) > getdate(self.posting_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 self.bill_no:
if cint(frappe.db.get_single_value("Accounts Settings", "check_supplier_invoice_uniqueness")): if cint(frappe.db.get_single_value("Accounts Settings", "check_supplier_invoice_uniqueness")):
@ -449,7 +449,7 @@ class PurchaseInvoice(BuyingController):
if pi: if pi:
pi = pi[0][0] 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): def update_billing_status_in_pr(self, update_modified=True):
updated_pr = [] updated_pr = []

View File

@ -313,8 +313,8 @@ def validate_party_frozen_disabled(party_type, party_name):
if party_type and party_name: if party_type and party_name:
party = frappe.db.get_value(party_type, party_name, ["is_frozen", "disabled"], as_dict=True) party = frappe.db.get_value(party_type, party_name, ["is_frozen", "disabled"], as_dict=True)
if party.disabled: 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: elif party.is_frozen:
frozen_accounts_modifier = frappe.db.get_value( 'Accounts Settings', None,'frozen_accounts_modifier') frozen_accounts_modifier = frappe.db.get_value( 'Accounts Settings', None,'frozen_accounts_modifier')
if not frozen_accounts_modifier in frappe.get_roles(): 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))

View File

@ -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 time log needs to be moved, make sure that the from time is not the same
if _from_time == time_log.from_time: 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_start_time = time_log.from_time
d.planned_end_time = time_log.to_time d.planned_end_time = time_log.to_time

View File

@ -193,7 +193,7 @@ class TimeLog(Document):
or self.get_overlap_for("user") or self.get_overlap_for("user")
if not overlapping: 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() self.from_time = get_datetime(overlapping.to_time) + get_mins_between_operations()