Fixed translations and tests (#12900)
* Fixed translations and tests * minor fixes * minor test fixes
This commit is contained in:
parent
361366ebe6
commit
e6d65bc2a1
@ -14,7 +14,7 @@ form_grid_templates = {
|
||||
class BankReconciliation(Document):
|
||||
def get_payment_entries(self):
|
||||
if not (self.bank_account and self.from_date and self.to_date):
|
||||
msgprint("Bank Account, From Date and To Date are Mandatory")
|
||||
msgprint(_("Bank Account, From Date and To Date are Mandatory"))
|
||||
return
|
||||
|
||||
condition = ""
|
||||
|
@ -4,8 +4,12 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
from frappe.model.naming import make_autoname
|
||||
from frappe.exceptions import ValidationError
|
||||
|
||||
class ShareDontExists(ValidationError): pass
|
||||
|
||||
class ShareTransfer(Document):
|
||||
def before_save(self):
|
||||
@ -66,44 +70,45 @@ class ShareTransfer(Document):
|
||||
# validate share doesnt exist in company
|
||||
ret_val = self.share_exists(self.get_shareholder_doc(self.company).name)
|
||||
if ret_val != False:
|
||||
frappe.throw('The shares already exist')
|
||||
frappe.throw(_('The shares already exist'), frappe.DuplicateEntryError)
|
||||
else:
|
||||
# validate share exists with from_shareholder
|
||||
ret_val = self.share_exists(self.from_shareholder)
|
||||
if ret_val != True:
|
||||
frappe.throw('The shares don\'t exist with the {0}'.format(self.from_shareholder))
|
||||
frappe.throw(_("The shares don't exist with the {0}")
|
||||
.format(self.from_shareholder), ShareDontExists)
|
||||
|
||||
def basic_validations(self):
|
||||
if self.transfer_type == 'Purchase':
|
||||
self.to_shareholder = ''
|
||||
if self.from_shareholder is None or self.from_shareholder is '':
|
||||
frappe.throw('The field \'From Shareholder\' cannot be blank')
|
||||
frappe.throw(_('The field From Shareholder cannot be blank'))
|
||||
if self.from_folio_no is None or self.from_folio_no is '':
|
||||
self.to_folio_no = self.autoname_folio(self.to_shareholder)
|
||||
elif (self.transfer_type == 'Issue'):
|
||||
self.from_shareholder = ''
|
||||
if self.to_shareholder is None or self.to_shareholder == '':
|
||||
frappe.throw('The field \'To Shareholder\' cannot be blank')
|
||||
frappe.throw(_('The field To Shareholder cannot be blank'))
|
||||
if self.to_folio_no is None or self.to_folio_no is '':
|
||||
self.to_folio_no = self.autoname_folio(self.to_shareholder)
|
||||
else:
|
||||
if self.from_shareholder is None or self.to_shareholder is None:
|
||||
frappe.throw('The fields \'From Shareholder\' and \'To Shareholder\' cannot be blank')
|
||||
frappe.throw(_('The fields From Shareholder and To Shareholder cannot be blank'))
|
||||
if self.to_folio_no is None or self.to_folio_no is '':
|
||||
self.to_folio_no = self.autoname_folio(self.to_shareholder)
|
||||
if self.from_shareholder == self.to_shareholder:
|
||||
frappe.throw('The seller and the buyer cannot be the same')
|
||||
frappe.throw(_('The seller and the buyer cannot be the same'))
|
||||
if self.no_of_shares != self.to_no - self.from_no + 1:
|
||||
frappe.throw('The number of shares and the share numbers are inconsistent!')
|
||||
frappe.throw(_('The number of shares and the share numbers are inconsistent'))
|
||||
if self.amount is None:
|
||||
self.amount = self.rate * self.no_of_shares
|
||||
if self.amount != self.rate * self.no_of_shares:
|
||||
frappe.throw('There\'s inconsistency between the rate, no of shares and the amount calculated')
|
||||
frappe.throw(_('There are inconsistencies between the rate, no of shares and the amount calculated'))
|
||||
|
||||
def share_exists(self, shareholder):
|
||||
# return True if exits,
|
||||
# False if completely doesn't exist,
|
||||
# 'partially exists' if partailly doesn't exist
|
||||
# return True if exits,
|
||||
# False if completely doesn't exist,
|
||||
# 'partially exists' if partailly doesn't exist
|
||||
ret_val = self.recursive_share_check(shareholder, self.share_type,
|
||||
query = {
|
||||
'from_no': self.from_no,
|
||||
@ -177,13 +182,14 @@ class ShareTransfer(Document):
|
||||
for shareholder in shareholders:
|
||||
doc = frappe.get_doc('Shareholder', self.get(shareholder))
|
||||
if doc.company != self.company:
|
||||
frappe.throw('The shareholder doesn\'t belong to this company')
|
||||
frappe.throw(_('The shareholder does not belong to this company'))
|
||||
if doc.folio_no is '' or doc.folio_no is None:
|
||||
doc.folio_no = self.from_folio_no if (shareholder == 'from_shareholder') else self.to_folio_no;
|
||||
doc.folio_no = self.from_folio_no \
|
||||
if (shareholder == 'from_shareholder') else self.to_folio_no;
|
||||
doc.save()
|
||||
else:
|
||||
if doc.folio_no != (self.from_folio_no if (shareholder == 'from_shareholder') else self.to_folio_no):
|
||||
frappe.throw('The folio numbers are not matching')
|
||||
frappe.throw(_('The folio numbers are not matching'))
|
||||
|
||||
def autoname_folio(self, shareholder, is_company=False):
|
||||
if is_company:
|
||||
@ -200,8 +206,8 @@ class ShareTransfer(Document):
|
||||
'from_no': self.from_no,
|
||||
'to_no' : self.to_no
|
||||
},
|
||||
rate = self.rate,
|
||||
amount = self.amount
|
||||
rate = self.rate,
|
||||
amount = self.amount
|
||||
)
|
||||
|
||||
def iterative_share_removal(self, shareholder, share_type, query, rate, amount):
|
||||
|
@ -1,76 +0,0 @@
|
||||
|
||||
[
|
||||
{
|
||||
"doctype" : "Company",
|
||||
"company_name" : "Stark Tower",
|
||||
"abbr" : "ST",
|
||||
"default_currency" : "INR"
|
||||
},
|
||||
{
|
||||
"doctype" : "Share Type",
|
||||
"title" : "Class A"
|
||||
},
|
||||
{
|
||||
"doctype" : "Share Transfer",
|
||||
"transfer_type" : "Issue",
|
||||
"date" : "2018-01-01",
|
||||
"to_shareholder" : "SH-00001",
|
||||
"share_type" : "Equity",
|
||||
"from_no" : 1,
|
||||
"to_no" : 500,
|
||||
"no_of_shares" : 500,
|
||||
"rate" : 10,
|
||||
"company" : "Stark Tower"
|
||||
},
|
||||
{
|
||||
"doctype" : "Share Transfer",
|
||||
"transfer_type" : "Transfer",
|
||||
"date" : "2018-01-02",
|
||||
"from_shareholder" : "SH-00001",
|
||||
"to_shareholder" : "SH-00002",
|
||||
"share_type" : "Equity",
|
||||
"from_no" : 101,
|
||||
"to_no" : 200,
|
||||
"no_of_shares" : 100,
|
||||
"rate" : 15,
|
||||
"company" : "Stark Tower"
|
||||
},
|
||||
{
|
||||
"doctype" : "Share Transfer",
|
||||
"transfer_type" : "Transfer",
|
||||
"date" : "2018-01-03",
|
||||
"from_shareholder" : "SH-00001",
|
||||
"to_shareholder" : "SH-00003",
|
||||
"share_type" : "Equity",
|
||||
"from_no" : 201,
|
||||
"to_no" : 500,
|
||||
"no_of_shares" : 300,
|
||||
"rate" : 20,
|
||||
"company" : "Stark Tower"
|
||||
},
|
||||
{
|
||||
"doctype" : "Share Transfer",
|
||||
"transfer_type" : "Transfer",
|
||||
"date" : "2018-01-04",
|
||||
"from_shareholder" : "SH-00001",
|
||||
"to_shareholder" : "SH-00002",
|
||||
"share_type" : "Equity",
|
||||
"from_no" : 201,
|
||||
"to_no" : 400,
|
||||
"no_of_shares" : 200,
|
||||
"rate" : 15,
|
||||
"company" : "Stark Tower"
|
||||
},
|
||||
{
|
||||
"doctype" : "Share Transfer",
|
||||
"transfer_type" : "Purchase",
|
||||
"date" : "2018-01-05",
|
||||
"from_shareholder" : "SH-00003",
|
||||
"share_type" : "Equity",
|
||||
"from_no" : 401,
|
||||
"to_no" : 500,
|
||||
"no_of_shares" : 100,
|
||||
"rate" : 25,
|
||||
"company" : "Stark Tower"
|
||||
}
|
||||
]
|
@ -5,11 +5,82 @@ from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
from frappe import ValidationError
|
||||
from erpnext.accounts.doctype.share_transfer.share_transfer import ShareDontExists
|
||||
|
||||
test_dependencies = ["Share Type", "Shareholder"]
|
||||
|
||||
class TestShareTransfer(unittest.TestCase):
|
||||
def setUp(self):
|
||||
frappe.db.sql("delete from `tabShare Transfer`")
|
||||
frappe.db.sql("delete from `tabShare Balance`")
|
||||
share_transfers = [
|
||||
{
|
||||
"doctype" : "Share Transfer",
|
||||
"transfer_type" : "Issue",
|
||||
"date" : "2018-01-01",
|
||||
"to_shareholder" : "SH-00001",
|
||||
"share_type" : "Equity",
|
||||
"from_no" : 1,
|
||||
"to_no" : 500,
|
||||
"no_of_shares" : 500,
|
||||
"rate" : 10,
|
||||
"company" : "_Test Company"
|
||||
},
|
||||
{
|
||||
"doctype" : "Share Transfer",
|
||||
"transfer_type" : "Transfer",
|
||||
"date" : "2018-01-02",
|
||||
"from_shareholder" : "SH-00001",
|
||||
"to_shareholder" : "SH-00002",
|
||||
"share_type" : "Equity",
|
||||
"from_no" : 101,
|
||||
"to_no" : 200,
|
||||
"no_of_shares" : 100,
|
||||
"rate" : 15,
|
||||
"company" : "_Test Company"
|
||||
},
|
||||
{
|
||||
"doctype" : "Share Transfer",
|
||||
"transfer_type" : "Transfer",
|
||||
"date" : "2018-01-03",
|
||||
"from_shareholder" : "SH-00001",
|
||||
"to_shareholder" : "SH-00003",
|
||||
"share_type" : "Equity",
|
||||
"from_no" : 201,
|
||||
"to_no" : 500,
|
||||
"no_of_shares" : 300,
|
||||
"rate" : 20,
|
||||
"company" : "_Test Company"
|
||||
},
|
||||
{
|
||||
"doctype" : "Share Transfer",
|
||||
"transfer_type" : "Transfer",
|
||||
"date" : "2018-01-04",
|
||||
"from_shareholder" : "SH-00003",
|
||||
"to_shareholder" : "SH-00002",
|
||||
"share_type" : "Equity",
|
||||
"from_no" : 201,
|
||||
"to_no" : 400,
|
||||
"no_of_shares" : 200,
|
||||
"rate" : 15,
|
||||
"company" : "_Test Company"
|
||||
},
|
||||
{
|
||||
"doctype" : "Share Transfer",
|
||||
"transfer_type" : "Purchase",
|
||||
"date" : "2018-01-05",
|
||||
"from_shareholder" : "SH-00003",
|
||||
"share_type" : "Equity",
|
||||
"from_no" : 401,
|
||||
"to_no" : 500,
|
||||
"no_of_shares" : 100,
|
||||
"rate" : 25,
|
||||
"company" : "_Test Company"
|
||||
}
|
||||
]
|
||||
for d in share_transfers:
|
||||
frappe.get_doc(d).insert()
|
||||
|
||||
def test_invalid_share_transfer(self):
|
||||
doc = frappe.get_doc({
|
||||
"doctype" : "Share Transfer",
|
||||
@ -22,11 +93,10 @@ class TestShareTransfer(unittest.TestCase):
|
||||
"to_no" : 100,
|
||||
"no_of_shares" : 100,
|
||||
"rate" : 15,
|
||||
"company" : "Stark Tower"
|
||||
"company" : "_Test Company"
|
||||
})
|
||||
self.assertRaises(ValidationError, doc.insert)
|
||||
self.assertRaises(ShareDontExists, doc.insert)
|
||||
|
||||
def test_invalid_share_purchase(self):
|
||||
doc = frappe.get_doc({
|
||||
"doctype" : "Share Transfer",
|
||||
"transfer_type" : "Purchase",
|
||||
@ -37,6 +107,6 @@ class TestShareTransfer(unittest.TestCase):
|
||||
"to_no" : 200,
|
||||
"no_of_shares" : 200,
|
||||
"rate" : 15,
|
||||
"company" : "Stark Tower"
|
||||
"company" : "_Test Company"
|
||||
})
|
||||
self.assertRaises(ValidationError, doc.insert)
|
||||
self.assertRaises(ShareDontExists, doc.insert)
|
||||
|
@ -42,7 +42,7 @@
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 1
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
@ -79,6 +79,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "SH-",
|
||||
"fieldname": "naming_series",
|
||||
"fieldtype": "Select",
|
||||
"hidden": 0,
|
||||
@ -477,7 +478,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2018-01-23 17:49:02.941363",
|
||||
"modified": "2018-02-13 06:43:36.319549",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Shareholder",
|
||||
|
@ -1,17 +1,20 @@
|
||||
[
|
||||
{
|
||||
"doctype": "Shareholder",
|
||||
"series": "SH-",
|
||||
"title": "Iron Man"
|
||||
"naming_series": "SH-",
|
||||
"title": "Iron Man",
|
||||
"company": "_Test Company"
|
||||
},
|
||||
{
|
||||
"doctype": "Shareholder",
|
||||
"series": "SH-",
|
||||
"title": "Thor"
|
||||
"naming_series": "SH-",
|
||||
"title": "Thor",
|
||||
"company": "_Test Company"
|
||||
},
|
||||
{
|
||||
"doctype": "Shareholder",
|
||||
"series": "SH-",
|
||||
"title": "Hulk"
|
||||
"naming_series": "SH-",
|
||||
"title": "Hulk",
|
||||
"company": "_Test Company"
|
||||
}
|
||||
]
|
@ -4,6 +4,7 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
|
||||
class Crop(Document):
|
||||
@ -12,7 +13,7 @@ class Crop(Document):
|
||||
for task in self.agriculture_task:
|
||||
# validate start_day is not > end_day
|
||||
if task.start_day > task.end_day:
|
||||
frappe.throw("Start day is greater than end day in task '{0}'".format(task.subject))
|
||||
frappe.throw(_("Start day is greater than end day in task '{0}'").format(task.subject))
|
||||
# to calculate the period of the Crop Cycle
|
||||
if task.end_day > max_period: max_period = task.end_day
|
||||
if max_period > self.period: self.period = max_period
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
import ast
|
||||
|
||||
@ -31,7 +32,7 @@ class CropCycle(Document):
|
||||
old_disease.append(detected_disease.name)
|
||||
if list(set(new_disease)-set(old_disease)) != []:
|
||||
self.update_disease(list(set(new_disease)-set(old_disease)))
|
||||
frappe.msgprint("All tasks for the detected diseases were imported")
|
||||
frappe.msgprint(_("All tasks for the detected diseases were imported"))
|
||||
|
||||
def update_disease(self, disease_hashes):
|
||||
new_disease = []
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
|
||||
class Disease(Document):
|
||||
@ -12,7 +13,7 @@ class Disease(Document):
|
||||
for task in self.treatment_task:
|
||||
# validate start_day is not > end_day
|
||||
if task.start_day > task.end_day:
|
||||
frappe.throw("Start day is greater than end day in task '{0}'".format(task.task_name))
|
||||
frappe.throw(_("Start day is greater than end day in task '{0}'").format(task.task_name))
|
||||
# to calculate the period of the Crop Cycle
|
||||
if task.end_day > max_period: max_period = task.end_day
|
||||
self.treatment_period = max_period
|
@ -4,6 +4,7 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import flt, cint
|
||||
|
||||
@ -20,9 +21,9 @@ class SoilTexture(Document):
|
||||
self.update_soil_edit('sand_composition')
|
||||
for soil_type in self.soil_types:
|
||||
if self.get(soil_type) > 100 or self.get(soil_type) < 0:
|
||||
frappe.throw("{0} should be a value between 0 and 100".format(soil_type))
|
||||
frappe.throw(_("{0} should be a value between 0 and 100").format(soil_type))
|
||||
if sum(self.get(soil_type) for soil_type in self.soil_types) != 100:
|
||||
frappe.throw('Soil compositions do not add up to 100')
|
||||
frappe.throw(_('Soil compositions do not add up to 100'))
|
||||
|
||||
def update_soil_edit(self, soil_type):
|
||||
self.soil_edit_order[self.soil_types.index(soil_type)] = max(self.soil_edit_order)+1
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
|
||||
class WaterAnalysis(Document):
|
||||
@ -18,6 +19,6 @@ class WaterAnalysis(Document):
|
||||
|
||||
def validate(self):
|
||||
if self.collection_datetime > self.laboratory_testing_datetime:
|
||||
frappe.throw('Lab testing datetime cannot be before collection datetime')
|
||||
frappe.throw(_('Lab testing datetime cannot be before collection datetime'))
|
||||
if self.laboratory_testing_datetime > self.result_datetime:
|
||||
frappe.throw('Lab result datetime cannot be before testing datetime')
|
||||
frappe.throw(_('Lab result datetime cannot be before testing datetime'))
|
@ -94,7 +94,7 @@ frappe.query_reports["Quoted Item Comparison"] = {
|
||||
},
|
||||
freeze: true,
|
||||
callback: (r) => {
|
||||
frappe.msgprint("Successfully Set Supplier");
|
||||
frappe.msgprint(__("Successfully Set Supplier"));
|
||||
dialog.hide();
|
||||
}
|
||||
});
|
||||
|
@ -194,7 +194,7 @@ class Opportunity(TransactionBase):
|
||||
self.customer = None
|
||||
elif self.enquiry_from == 'Customer':
|
||||
if not self.customer:
|
||||
msgprint("Customer is mandatory if 'Opportunity From' is selected as Customer", raise_exception=1)
|
||||
msgprint(_("Customer is mandatory if 'Opportunity From' is selected as Customer"), raise_exception=1)
|
||||
else:
|
||||
self.lead = None
|
||||
|
||||
|
@ -335,7 +335,7 @@ def get_assessment_result_doc(student, assessment_plan):
|
||||
if doc.docstatus == 0:
|
||||
return doc
|
||||
elif doc.docstatus == 1:
|
||||
frappe.msgprint("Result already Submitted")
|
||||
frappe.msgprint(_("Result already Submitted"))
|
||||
return None
|
||||
else:
|
||||
return frappe.new_doc("Assessment Result")
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
|
||||
STD_CRITERIA = ["total", "total score", "total grade", "maximum score", "score", "grade"]
|
||||
@ -11,4 +12,4 @@ STD_CRITERIA = ["total", "total score", "total grade", "maximum score", "score",
|
||||
class AssessmentCriteria(Document):
|
||||
def validate(self):
|
||||
if self.assessment_criteria.lower() in STD_CRITERIA:
|
||||
frappe.throw("Can't create standard criteria. Please rename the criteria")
|
||||
frappe.throw(_("Can't create standard criteria. Please rename the criteria"))
|
@ -18,7 +18,7 @@ class Instructor(Document):
|
||||
self.name = make_autoname(self.naming_series + '.####')
|
||||
elif naming_method == 'Employee Number':
|
||||
if not self.employee:
|
||||
frappe.throw("Please select Employee")
|
||||
frappe.throw(_("Please select Employee"))
|
||||
self.name = self.employee
|
||||
elif naming_method == 'Full Name':
|
||||
self.name = self.instructor_name
|
||||
|
@ -63,4 +63,4 @@ class ProgramEnrollmentTool(Document):
|
||||
prog_enrollment.academic_term = self.academic_term
|
||||
prog_enrollment.student_batch_name = stud.student_batch_name if stud.student_batch_name else self.new_student_batch
|
||||
prog_enrollment.save()
|
||||
frappe.msgprint("{0} Students have been enrolled.".format(total))
|
||||
frappe.msgprint(_("{0} Students have been enrolled").format(total))
|
||||
|
@ -41,7 +41,7 @@ frappe.ui.form.on('Consultation', {
|
||||
frappe.route_options = {"patient": frm.doc.patient};
|
||||
frappe.set_route("medical_record");
|
||||
} else {
|
||||
frappe.msgprint("Please select Patient");
|
||||
frappe.msgprint(__("Please select Patient"));
|
||||
}
|
||||
},"View");
|
||||
frm.add_custom_button(__('Vital Signs'), function() {
|
||||
@ -121,7 +121,7 @@ var btn_invoice_consultation = function(frm){
|
||||
|
||||
var create_medical_record = function (frm) {
|
||||
if(!frm.doc.patient){
|
||||
frappe.throw("Please select patient");
|
||||
frappe.throw(__("Please select patient"));
|
||||
}
|
||||
frappe.route_options = {
|
||||
"patient": frm.doc.patient,
|
||||
@ -134,7 +134,7 @@ var create_medical_record = function (frm) {
|
||||
|
||||
var btn_create_vital_signs = function (frm) {
|
||||
if(!frm.doc.patient){
|
||||
frappe.throw("Please select patient");
|
||||
frappe.throw(__("Please select patient"));
|
||||
}
|
||||
frappe.route_options = {
|
||||
"patient": frm.doc.patient,
|
||||
|
@ -21,7 +21,7 @@ class Consultation(Document):
|
||||
|
||||
def on_submit(self):
|
||||
if not self.diagnosis or not self.symptoms:
|
||||
frappe.throw("Diagnosis and Complaints cannot be left blank")
|
||||
frappe.throw(_("Diagnosis and Complaints cannot be left blank"))
|
||||
|
||||
def on_cancel(self):
|
||||
if(self.appointment):
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
from frappe.core.doctype.sms_settings.sms_settings import send_sms
|
||||
import json
|
||||
@ -15,7 +16,7 @@ class HealthcareSettings(Document):
|
||||
frappe.db.set_default(key, self.get(key, ""))
|
||||
if(self.collect_registration_fee):
|
||||
if self.registration_fee <= 0 :
|
||||
frappe.throw("Registration fee can not be Zero")
|
||||
frappe.throw(_("Registration fee can not be Zero"))
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_sms_text(doc):
|
||||
|
@ -101,14 +101,14 @@ frappe.ui.form.on("Lab Test", "patient", function(frm) {
|
||||
|
||||
frappe.ui.form.on('Normal Test Items', {
|
||||
normal_test_items_remove: function() {
|
||||
frappe.msgprint("Not permitted, configure Lab Test Template as required");
|
||||
frappe.msgprint(__("Not permitted, configure Lab Test Template as required"));
|
||||
cur_frm.reload_doc();
|
||||
}
|
||||
});
|
||||
|
||||
frappe.ui.form.on('Special Test Items', {
|
||||
special_test_items_remove: function() {
|
||||
frappe.msgprint("Not permitted, configure Lab Test Template as required");
|
||||
frappe.msgprint(__("Not permitted, configure Lab Test Template as required"));
|
||||
cur_frm.reload_doc();
|
||||
}
|
||||
});
|
||||
@ -142,7 +142,7 @@ var get_lab_test_prescribed = function(frm){
|
||||
});
|
||||
}
|
||||
else{
|
||||
frappe.msgprint("Please select Patient to get Lab Tests");
|
||||
frappe.msgprint(__("Please select Patient to get Lab Tests"));
|
||||
}
|
||||
};
|
||||
|
||||
@ -217,7 +217,7 @@ cur_frm.cscript.custom_before_submit = function(doc) {
|
||||
if(doc.normal_test_items){
|
||||
for(let result in doc.normal_test_items){
|
||||
if(!doc.normal_test_items[result].result_value && doc.normal_test_items[result].require_result_value == 1){
|
||||
frappe.msgprint("Please input all required Result Value(s)");
|
||||
frappe.msgprint(__("Please input all required Result Value(s)"));
|
||||
throw("Error");
|
||||
}
|
||||
}
|
||||
@ -225,7 +225,7 @@ cur_frm.cscript.custom_before_submit = function(doc) {
|
||||
if(doc.special_test_items){
|
||||
for(let result in doc.special_test_items){
|
||||
if(!doc.special_test_items[result].result_value && doc.special_test_items[result].require_result_value == 1){
|
||||
frappe.msgprint("Please input all required Result Value(s)");
|
||||
frappe.msgprint(__("Please input all required Result Value(s)"));
|
||||
throw("Error");
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ class LabTestTemplate(Document):
|
||||
try:
|
||||
frappe.delete_doc("Item",self.item)
|
||||
except Exception:
|
||||
frappe.throw("""Not permitted. Please disable the Test Template""")
|
||||
frappe.throw(_("""Not permitted. Please disable the Test Template"""))
|
||||
|
||||
def item_price_exist(doc):
|
||||
item_price = frappe.db.exists({
|
||||
|
@ -53,7 +53,7 @@ frappe.ui.form.on("Patient", "dob", function(frm) {
|
||||
var today = new Date();
|
||||
var birthDate = new Date(frm.doc.dob);
|
||||
if(today < birthDate){
|
||||
frappe.msgprint("Please select a valid Date");
|
||||
frappe.msgprint(__("Please select a valid Date"));
|
||||
frappe.model.set_value(frm.doctype,frm.docname, "dob", "");
|
||||
}
|
||||
else{
|
||||
@ -83,7 +83,7 @@ var get_age = function (birth) {
|
||||
|
||||
var btn_create_vital_signs = function (frm) {
|
||||
if (!frm.doc.name) {
|
||||
frappe.throw("Please save the patient first");
|
||||
frappe.throw(__("Please save the patient first"));
|
||||
}
|
||||
frappe.route_options = {
|
||||
"patient": frm.doc.name,
|
||||
@ -93,7 +93,7 @@ var btn_create_vital_signs = function (frm) {
|
||||
|
||||
var btn_create_consultation = function (frm) {
|
||||
if (!frm.doc.name) {
|
||||
frappe.throw("Please save the patient first");
|
||||
frappe.throw(__("Please save the patient first"));
|
||||
}
|
||||
frappe.route_options = {
|
||||
"patient": frm.doc.name,
|
||||
|
@ -116,8 +116,9 @@ def make_invoice(patient, company):
|
||||
def get_patient_detail(patient):
|
||||
patient_dict = frappe.db.sql("""select * from tabPatient where name=%s""", (patient), as_dict=1)
|
||||
if not patient_dict:
|
||||
frappe.throw("Patient not found")
|
||||
vital_sign = frappe.db.sql("""select * from `tabVital Signs` where patient=%s order by signs_date desc limit 1""", (patient), as_dict=1)
|
||||
frappe.throw(_("Patient not found"))
|
||||
vital_sign = frappe.db.sql("""select * from `tabVital Signs` where patient=%s
|
||||
order by signs_date desc limit 1""", (patient), as_dict=1)
|
||||
|
||||
details = patient_dict[0]
|
||||
if vital_sign:
|
||||
|
@ -181,7 +181,7 @@ var btn_create_consultation = function(frm){
|
||||
|
||||
var btn_create_vital_signs = function (frm) {
|
||||
if(!frm.doc.patient){
|
||||
frappe.throw("Please select patient");
|
||||
frappe.throw(__("Please select patient"));
|
||||
}
|
||||
frappe.route_options = {
|
||||
"patient": frm.doc.patient,
|
||||
|
@ -5,7 +5,7 @@ from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
test_dependents = ["Hotel Room Package"]
|
||||
test_dependencies = ["Hotel Room Package"]
|
||||
test_records = [
|
||||
dict(doctype="Hotel Room", name="1001",
|
||||
hotel_room_type="Basic Room"),
|
||||
|
@ -5,7 +5,7 @@ from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
test_dependencies = ["Hotel Room Package"]
|
||||
test_records = [
|
||||
dict(doctype="Hotel Room Pricing", enabled=1,
|
||||
name="Winter 2017",
|
||||
|
@ -6,7 +6,7 @@ from __future__ import unicode_literals
|
||||
import frappe
|
||||
import unittest
|
||||
from erpnext.hotels.doctype.hotel_room_reservation.hotel_room_reservation import HotelRoomPricingNotSetError, HotelRoomUnavailableError
|
||||
test_dependencies = ["Hotel Room Pricing", "Hotel Room"]
|
||||
test_dependencies = ["Hotel Room Package", "Hotel Room Pricing", "Hotel Room"]
|
||||
|
||||
class TestHotelRoomReservation(unittest.TestCase):
|
||||
def setUp(self):
|
||||
|
@ -311,7 +311,7 @@ frappe.ui.form.on("Expense Claim Advance", {
|
||||
employee_advance: function(frm, cdt, cdn) {
|
||||
var child = locals[cdt][cdn];
|
||||
if(!frm.doc.employee){
|
||||
frappe.msgprint('Select an employee to get the employee advance.');
|
||||
frappe.msgprint(__('Select an employee to get the employee advance.'));
|
||||
frm.doc.advances = [];
|
||||
refresh_field("advances");
|
||||
}
|
||||
|
@ -245,10 +245,6 @@ class TestLeaveApplication(unittest.TestCase):
|
||||
application.insert()
|
||||
|
||||
frappe.set_user("test@example.com")
|
||||
|
||||
# clear permlevel access cache on change user
|
||||
del application._has_access_to
|
||||
|
||||
self.assertRaises(LeaveDayBlockedError, application.submit)
|
||||
|
||||
frappe.db.set_value("Leave Block List", "_Test Leave Block List",
|
||||
|
@ -455,13 +455,13 @@ def format_as_links(salary_slip):
|
||||
def create_submit_log(submitted_ss, not_submitted_ss, jv_name):
|
||||
|
||||
if not submitted_ss and not not_submitted_ss:
|
||||
frappe.msgprint("No salary slip found to submit for the above selected criteria OR salary slip already submitted")
|
||||
frappe.msgprint(_("No salary slip found to submit for the above selected criteria OR salary slip already submitted"))
|
||||
|
||||
if not_submitted_ss:
|
||||
frappe.msgprint("Could not submit any Salary Slip <br>\
|
||||
frappe.msgprint(_("Could not submit any Salary Slip <br>\
|
||||
Possible reasons: <br>\
|
||||
1. Net pay is less than 0. <br>\
|
||||
2. Company Email Address specified in employee master is not valid. <br>")
|
||||
2. Company Email Address specified in employee master is not valid. <br>"))
|
||||
|
||||
|
||||
def get_salary_slip_list(name, docstatus, as_dict=0):
|
||||
|
@ -46,7 +46,7 @@ frappe.ui.form.on("Hub Settings", {
|
||||
set_enable_hub_primary_button: (frm) => {
|
||||
frm.page.set_primary_action(__("Enable Hub"), () => {
|
||||
if(frappe.session.user === "Administrator") {
|
||||
frappe.msgprint("Please login as another user.")
|
||||
frappe.msgprint(__("Please login as another user."))
|
||||
} else {
|
||||
frappe.verify_password(() => {
|
||||
this.frm.call({
|
||||
|
@ -492,5 +492,5 @@ erpnext.patches.v10_0.added_extra_gst_custom_field
|
||||
erpnext.patches.v10_0.workflow_leave_application #2018-01-24 #2018-02-02 #2018-02-08
|
||||
erpnext.patches.v10_0.set_default_payment_terms_based_on_company
|
||||
erpnext.patches.v10_0.update_sales_order_link_to_purchase_order
|
||||
erpnext.patches.v10_0.added_extra_gst_custom_field_in_gstr2
|
||||
erpnext.patches.v10_0.added_extra_gst_custom_field_in_gstr2 #2018-02-13
|
||||
erpnext.patches.v10_0.item_barcode_childtable_migrate
|
||||
|
@ -6,4 +6,13 @@ def execute():
|
||||
if not company:
|
||||
return
|
||||
|
||||
make_custom_fields()
|
||||
make_custom_fields()
|
||||
|
||||
frappe.db.sql("""
|
||||
update `tabCustom Field`
|
||||
set reqd = 0, `default` = ''
|
||||
where fieldname = 'reason_for_issuing_document'
|
||||
""")
|
||||
|
||||
frappe.db.sql("""delete from `tabCustom Field` where dt = 'Purchase Invoice'
|
||||
and fieldname in ('port_code', 'shipping_bill_number', 'shipping_bill_date')""")
|
@ -3,7 +3,6 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from erpnext.stock.doctype.bin.bin import update_item_projected_qty
|
||||
|
||||
def execute():
|
||||
repost_bin_qty()
|
||||
|
@ -133,7 +133,7 @@ var get_payment_mode_account = function(frm, mode_of_payment, callback) {
|
||||
cur_frm.cscript.account_head = function(doc, cdt, cdn) {
|
||||
var d = locals[cdt][cdn];
|
||||
if(!d.charge_type && d.account_head){
|
||||
frappe.msgprint("Please select Charge Type first");
|
||||
frappe.msgprint(__("Please select Charge Type first"));
|
||||
frappe.model.set_value(cdt, cdn, "account_head", "");
|
||||
} else if(d.account_head && d.charge_type!=="Actual") {
|
||||
frappe.call({
|
||||
|
@ -252,10 +252,12 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
|
||||
d.qty = d.qty - my_qty;
|
||||
cur_frm.doc.items[i].stock_qty = my_qty*cur_frm.doc.items[i].conversion_factor;
|
||||
cur_frm.doc.items[i].qty = my_qty;
|
||||
|
||||
frappe.msgprint("Assigning " + d.mr_name + " to " + d.item_code + " (row " + cur_frm.doc.items[i].idx + ")");
|
||||
|
||||
frappe.msgprint(__("Assigning {0} to {1} (row {2})",
|
||||
[d.mr_name, d.item_code, cur_frm.doc.items[i].idx]);
|
||||
|
||||
if (qty > 0) {
|
||||
frappe.msgprint("Splitting " + qty + " units of " + d.item_code);
|
||||
frappe.msgprint(__("Splitting {0} units of {1}", [qty, d.item_code]);
|
||||
var newrow = frappe.model.add_child(cur_frm.doc, cur_frm.doc.items[i].doctype, "items");
|
||||
item_length++;
|
||||
|
||||
|
@ -84,7 +84,7 @@ erpnext.setup.slides_settings = [
|
||||
|
||||
slide.get_input("company_abbr").on("change", function () {
|
||||
if (slide.get_input("company_abbr").val().length > 5) {
|
||||
frappe.msgprint("Company Abbreviation cannot have more than 5 characters");
|
||||
frappe.msgprint(__("Company Abbreviation cannot have more than 5 characters"));
|
||||
slide.get_field("company_abbr").set_value("");
|
||||
}
|
||||
});
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe, os
|
||||
from frappe import _
|
||||
from frappe.utils import get_url, nowdate, date_diff
|
||||
from frappe.model.document import Document
|
||||
from frappe.contacts.doctype.contact.contact import get_default_contact
|
||||
@ -24,13 +25,13 @@ def send_reminder():
|
||||
|
||||
last_sent = frappe.db.get_single_value('GST Settings', 'gstin_email_sent_on')
|
||||
if last_sent and date_diff(nowdate(), last_sent) < 3:
|
||||
frappe.throw("Please wait 3 days before resending the reminder.")
|
||||
frappe.throw(_("Please wait 3 days before resending the reminder."))
|
||||
|
||||
frappe.db.set_value('GST Settings', 'GST Settings', 'gstin_email_sent_on', nowdate())
|
||||
|
||||
# enqueue if large number of customers, suppliser
|
||||
frappe.enqueue('erpnext.regional.doctype.gst_settings.gst_settings.send_gstin_reminder_to_all_parties')
|
||||
frappe.msgprint('Email Reminders will be sent to all parties with email contacts')
|
||||
frappe.msgprint(_('Email Reminders will be sent to all parties with email contacts'))
|
||||
|
||||
def send_gstin_reminder_to_all_parties():
|
||||
parties = []
|
||||
@ -60,7 +61,7 @@ def send_gstin_reminder(party_type, party):
|
||||
frappe.has_permission(party_type, throw=True)
|
||||
email = _send_gstin_reminder(party_type ,party)
|
||||
if email:
|
||||
frappe.msgprint('Reminder to update GSTIN Sent', title='Reminder sent', indicator='green')
|
||||
frappe.msgprint(_('Reminder to update GSTIN Sent'), title='Reminder sent', indicator='green')
|
||||
|
||||
def _send_gstin_reminder(party_type, party, default_email_id=None, sent_to=None):
|
||||
'''Send GST Reminder email'''
|
||||
@ -70,7 +71,7 @@ def _send_gstin_reminder(party_type, party, default_email_id=None, sent_to=None)
|
||||
email_id = default_email_id
|
||||
|
||||
if not email_id:
|
||||
frappe.throw('Email not found in default contact', exc=EmailMissing)
|
||||
frappe.throw(_('Email not found in default contact'), exc=EmailMissing)
|
||||
|
||||
if sent_to and email_id in sent_to:
|
||||
return
|
||||
|
@ -95,7 +95,7 @@ def make_custom_fields():
|
||||
fieldtype='Select', insert_after='invoice_copy', print_hide=1,
|
||||
options='Y\nN', default='N'),
|
||||
dict(fieldname='invoice_type', label='Invoice Type',
|
||||
fieldtype='Select', insert_after='gst_col_break', print_hide=1,
|
||||
fieldtype='Select', insert_after='invoice_copy', print_hide=1,
|
||||
options='Regular\nSEZ\nExport\nDeemed Export', default='Regular'),
|
||||
dict(fieldname='export_type', label='Export Type',
|
||||
fieldtype='Select', insert_after='invoice_type', print_hide=1,
|
||||
@ -103,10 +103,10 @@ def make_custom_fields():
|
||||
options='\nWith Payment of Tax\nWithout Payment of Tax'),
|
||||
dict(fieldname='ecommerce_gstin', label='E-commerce GSTIN',
|
||||
fieldtype='Data', insert_after='export_type', print_hide=1),
|
||||
dict(fieldname='gst_col_break', fieldtype='Column Break', insert_after='reason_for_issuing_document'),
|
||||
dict(fieldname='gst_col_break', fieldtype='Column Break', insert_after='ecommerce_gstin'),
|
||||
dict(fieldname='reason_for_issuing_document', label='Reason For Issuing document',
|
||||
fieldtype='Select', insert_after='gst_col_break', print_hide=1,
|
||||
depends_on='eval:doc.is_return==1', reqd=1,
|
||||
depends_on='eval:doc.is_return==1',
|
||||
options='\n01-Sales Return\n02-Post Sale Discount\n03-Deficiency in services\n04-Correction in Invoice\n05-Change in POS\n06-Finalization of Provisional assessment\n07-Others')
|
||||
]
|
||||
|
||||
|
@ -92,7 +92,7 @@ frappe.ui.form.on("Company", {
|
||||
},
|
||||
function(data) {
|
||||
if(data.company_name !== frm.doc.name) {
|
||||
frappe.msgprint("Company name not same");
|
||||
frappe.msgprint(__("Company name not same"));
|
||||
return;
|
||||
}
|
||||
frappe.call({
|
||||
|
@ -27,7 +27,7 @@ class NamingSeries(Document):
|
||||
try:
|
||||
options = self.get_options(d)
|
||||
except frappe.DoesNotExistError:
|
||||
frappe.msgprint('Unable to find DocType {0}'.format(d))
|
||||
frappe.msgprint(_('Unable to find DocType {0}').format(d))
|
||||
#frappe.pass_does_not_exist_error()
|
||||
continue
|
||||
|
||||
|
@ -115,8 +115,8 @@ class Batch(Document):
|
||||
self.expiry_date = add_days(self.manufacturing_date, shelf_life_in_days)
|
||||
|
||||
if has_expiry_date and not self.expiry_date:
|
||||
frappe.throw('Expiry date is mandatory for selected item')
|
||||
frappe.msgprint('Set items shelf life in days, to set expiry based on manufacturing_date plus self life ')
|
||||
frappe.throw(_('Expiry date is mandatory for selected item'))
|
||||
frappe.msgprint(_('Set items shelf life in days, to set expiry based on manufacturing_date plus self life'))
|
||||
|
||||
def get_name_from_naming_series(self):
|
||||
"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user