more message fixes for translation
This commit is contained in:
parent
ff93802d58
commit
d85dc868ca
@ -80,8 +80,7 @@ class MaterialRequest(BuyingController):
|
||||
for d in self.get('indent_details'):
|
||||
if frappe.db.get_value("Item", d.item_code, "is_stock_item") == "Yes":
|
||||
if not d.warehouse:
|
||||
frappe.throw("Please Enter Warehouse for Item %s as it is stock item"
|
||||
% cstr(d.item_code))
|
||||
frappe.throw(_("Warehouse required for stock Item {0}").format(d.item_code))
|
||||
|
||||
qty =flt(d.qty)
|
||||
if is_stopped:
|
||||
@ -106,7 +105,7 @@ class MaterialRequest(BuyingController):
|
||||
% (mod_db[0][0], cstr(self.modified)))
|
||||
|
||||
if date_diff and date_diff[0][0]:
|
||||
frappe.throw(cstr(self.doctype) + " => " + cstr(self.name) + " has been modified. Please Refresh.")
|
||||
frappe.throw(_("{0} {1} has been modified. Please refresh.").format(_(self.doctype), self.name))
|
||||
|
||||
def update_status(self, status):
|
||||
self.check_modified_date()
|
||||
|
@ -259,8 +259,7 @@ class PurchaseReceipt(BuyingController):
|
||||
where t1.name = t2.parent and t2.purchase_receipt = %s and t1.docstatus = 1""",
|
||||
self.name)
|
||||
if submitted:
|
||||
frappe.throw("Purchase Invoice : " + cstr(submitted[0][0]) +
|
||||
" has already been submitted !")
|
||||
frappe.throw(_("Purchase Invoice {0} is already submitted").format(submitted[0][0]))
|
||||
|
||||
frappe.db.set(self,'status','Cancelled')
|
||||
|
||||
|
@ -263,14 +263,10 @@ class StockEntry(StockController):
|
||||
ref_item = ref.doc.getone({"item_code": item.item_code})
|
||||
returnable_qty = ref_item.qty - flt(already_returned_item_qty.get(item.item_code))
|
||||
if not returnable_qty:
|
||||
frappe.throw("{item}: {item_code} {returned}".format(
|
||||
item=_("Item"), item_code=item.item_code,
|
||||
returned=_("already returned though some other documents")),
|
||||
StockOverReturnError)
|
||||
frappe.throw(_("Item {0} has already been returned").format(item.item_code), StockOverReturnError)
|
||||
elif item.transfer_qty > returnable_qty:
|
||||
frappe.throw("{item}: {item_code}, {returned}: {qty}".format(
|
||||
item=_("Item"), item_code=item.item_code,
|
||||
returned=_("Max Returnable Qty"), qty=returnable_qty), StockOverReturnError)
|
||||
frappe.throw(_("Cannot return more than {0} for Item {1}").format(returnable_qty, item.item_code),
|
||||
StockOverReturnError)
|
||||
|
||||
def get_already_returned_item_qty(self, ref_fieldname):
|
||||
return dict(frappe.db.sql("""select item_code, sum(transfer_qty) as qty
|
||||
|
@ -39,16 +39,9 @@ class StockLedgerEntry(DocListController):
|
||||
(self.warehouse, self.item_code, self.batch_no))[0][0])
|
||||
|
||||
if batch_bal_after_transaction < 0:
|
||||
self.update({
|
||||
'batch_bal': batch_bal_after_transaction - self.actual_qty
|
||||
})
|
||||
|
||||
frappe.throw("""Not enough quantity (requested: %(actual_qty)s, \
|
||||
current: %(batch_bal)s in Batch <b>%(batch_no)s</b> for Item \
|
||||
<b>%(item_code)s</b> at Warehouse <b>%(warehouse)s</b> \
|
||||
as on %(posting_date)s %(posting_time)s""" % self.as_dict())
|
||||
|
||||
self.pop('batch_bal')
|
||||
frappe.throw(_("Negative balance in Batch {0} for Item {1} at Warehouse {2} on {3} {4}").format(\
|
||||
batch_bal_after_transaction - self.actual_qty, self.item_code, self.warehouse,
|
||||
formatdate(self.posting_date), self.posting_time))
|
||||
|
||||
def validate_mandatory(self):
|
||||
mandatory = ['warehouse','posting_date','voucher_type','voucher_no','actual_qty','company']
|
||||
@ -63,18 +56,17 @@ class StockLedgerEntry(DocListController):
|
||||
self.item_code, as_dict=True)[0]
|
||||
|
||||
if item_det.is_stock_item != 'Yes':
|
||||
frappe.throw("""Item: "%s" is not a Stock Item.""" % self.item_code)
|
||||
frappe.throw(_("Item {0} must be a stock Item").format(self.item_code))
|
||||
|
||||
# check if batch number is required
|
||||
if item_det.has_batch_no =='Yes' and self.voucher_type != 'Stock Reconciliation':
|
||||
if not self.batch_no:
|
||||
frappe.throw("Batch number is mandatory for Item '%s'" % self.item_code)
|
||||
frappe.throw("Batch number is mandatory for Item {0}".format(self.item_code))
|
||||
|
||||
# check if batch belongs to item
|
||||
if not frappe.db.get_value("Batch",
|
||||
{"item": self.item_code, "name": self.batch_no}):
|
||||
frappe.throw("'%s' is not a valid Batch Number for Item '%s'" %
|
||||
(self.batch_no, self.item_code))
|
||||
frappe.throw(_("{0} is not a valid Batch Number for Item {1}").format(self.batch_no, self.item_code))
|
||||
|
||||
if not self.stock_uom:
|
||||
self.stock_uom = item_det.stock_uom
|
||||
|
@ -4,7 +4,7 @@
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
from frappe.utils import add_days, cstr, getdate, cint
|
||||
from frappe.utils import add_days, getdate, cint
|
||||
|
||||
from frappe import throw, _
|
||||
from erpnext.utilities.transaction_base import TransactionBase, delete_events
|
||||
@ -46,7 +46,7 @@ class MaintenanceSchedule(TransactionBase):
|
||||
|
||||
def on_submit(self):
|
||||
if not self.get('maintenance_schedule_detail'):
|
||||
throw("Please click on 'Generate Schedule' to get schedule")
|
||||
throw(_("Please click on 'Generate Schedule' to get schedule"))
|
||||
self.check_serial_no_added()
|
||||
self.validate_schedule()
|
||||
|
||||
@ -141,12 +141,12 @@ class MaintenanceSchedule(TransactionBase):
|
||||
period = (getdate(args['end_date']) - getdate(args['start_date'])).days + 1
|
||||
|
||||
if (args['periodicity'] == 'Yearly' or args['periodicity'] == 'Half Yearly' or
|
||||
args['periodicity'] == 'Quarterly') and period < 365:
|
||||
throw(cstr(args['periodicity']) + " periodicity can be set for period of atleast 1 year or more only")
|
||||
args['periodicity'] == 'Quarterly') and period < 90:
|
||||
throw(_("Period is too short"))
|
||||
elif args['periodicity'] == 'Monthly' and period < 30:
|
||||
throw("Monthly periodicity can be set for period of atleast 1 month or more")
|
||||
throw(_("Period is too short"))
|
||||
elif args['periodicity'] == 'Weekly' and period < 7:
|
||||
throw("Weekly periodicity can be set for period of atleast 1 week or more")
|
||||
throw(_("Period is too short"))
|
||||
|
||||
def get_no_of_visits(self, arg):
|
||||
args = eval(arg)
|
||||
@ -192,7 +192,7 @@ class MaintenanceSchedule(TransactionBase):
|
||||
`tabMaintenance Schedule Item` msi where msi.parent=ms.name and
|
||||
msi.prevdoc_docname=%s and ms.docstatus=1""", d.prevdoc_docname)
|
||||
if chk:
|
||||
throw("Maintenance Schedule against " + d.prevdoc_docname + " already exist")
|
||||
throw(_("Maintenance Schedule {0} exists against {0}").format(chk[0][0], d.prevdoc_docname))
|
||||
|
||||
def validate(self):
|
||||
self.validate_maintenance_detail()
|
||||
@ -213,12 +213,10 @@ class MaintenanceSchedule(TransactionBase):
|
||||
["warranty_expiry_date", "amc_expiry_date", "status", "delivery_date"], as_dict=1)
|
||||
|
||||
if sr_details.warranty_expiry_date and sr_details.warranty_expiry_date>=amc_start_date:
|
||||
throw("""Serial No: %s is already under warranty upto %s.
|
||||
Please check AMC Start Date.""" % (serial_no, sr_details.warranty_expiry_date))
|
||||
throw(_("Serial No {0} is under warranty upto {1}").format(serial_no, sr_details.warranty_expiry_date))
|
||||
|
||||
if sr_details.amc_expiry_date and sr_details.amc_expiry_date >= amc_start_date:
|
||||
throw("""Serial No: %s is already under AMC upto %s.
|
||||
Please check AMC Start Date.""" % (serial_no, sr_details.amc_expiry_date))
|
||||
throw(_("Serial No {0} is under maintenance contract upto {1}").format(serial_no, sr_details.amc_start_date))
|
||||
|
||||
if sr_details.status=="Delivered" and sr_details.delivery_date and \
|
||||
sr_details.delivery_date >= amc_start_date:
|
||||
@ -252,7 +250,7 @@ class MaintenanceSchedule(TransactionBase):
|
||||
for m in self.get('maintenance_schedule_detail'):
|
||||
if serial_present:
|
||||
if m.item_code in serial_present and not m.serial_no:
|
||||
throw("Please click on 'Generate Schedule' to fetch serial no added for item "+m.item_code)
|
||||
throw(_("Please click on 'Generate Schedule' to fetch Serial No added for Item {0}").format(m.item_code))
|
||||
|
||||
def on_cancel(self):
|
||||
for d in self.get('item_maintenance_detail'):
|
||||
|
@ -15,8 +15,7 @@ class MaintenanceVisit(TransactionBase):
|
||||
def validate_serial_no(self):
|
||||
for d in self.get('maintenance_visit_details'):
|
||||
if d.serial_no and not frappe.db.exists("Serial No", d.serial_no):
|
||||
frappe.throw("Serial No: "+ d.serial_no + " not exists in the system")
|
||||
|
||||
frappe.throw(_("Serial No {0} does not exist").format(d.serial_no))
|
||||
|
||||
def validate(self):
|
||||
self.validate_serial_no()
|
||||
@ -51,11 +50,11 @@ class MaintenanceVisit(TransactionBase):
|
||||
|
||||
def check_if_last_visit(self):
|
||||
"""check if last maintenance visit against same sales order/ customer issue"""
|
||||
check_for_docname = check_for_doctype = None
|
||||
check_for_docname = None
|
||||
for d in self.get('maintenance_visit_details'):
|
||||
if d.prevdoc_docname:
|
||||
check_for_docname = d.prevdoc_docname
|
||||
check_for_doctype = d.prevdoc_doctype
|
||||
#check_for_doctype = d.prevdoc_doctype
|
||||
|
||||
if check_for_docname:
|
||||
check = frappe.db.sql("select t1.name from `tabMaintenance Visit` t1, `tabMaintenance Visit Purpose` t2 where t2.parent = t1.name and t1.name!=%s and t2.prevdoc_docname=%s and t1.docstatus = 1 and (t1.mntc_date > %s or (t1.mntc_date = %s and t1.mntc_time > %s))", (self.name, check_for_docname, self.mntc_date, self.mntc_date, self.mntc_time))
|
||||
|
Loading…
x
Reference in New Issue
Block a user