mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 07:54:46 +00:00
[hub] Merge Develop
This commit is contained in:
@@ -14,7 +14,7 @@ def setup(domain):
|
||||
setup_fiscal_year()
|
||||
setup_holiday_list()
|
||||
setup_user()
|
||||
setup_employee()
|
||||
#setup_employee()
|
||||
setup_user_roles()
|
||||
setup_role_permissions()
|
||||
|
||||
@@ -293,7 +293,7 @@ def setup_currency_exchange():
|
||||
}).insert()
|
||||
|
||||
def setup_mode_of_payment():
|
||||
company_abbr = frappe.db.get_value("Company", erpnext.get_default_company(), "abbr")
|
||||
company_abbr = frappe.get_cached_value('Company', erpnext.get_default_company(), "abbr")
|
||||
account_dict = {'Cash': 'Cash - '+ company_abbr , 'Bank': 'National Bank - '+ company_abbr}
|
||||
for payment_mode in frappe.get_all('Mode of Payment', fields = ["name", "type"]):
|
||||
if payment_mode.type:
|
||||
@@ -317,7 +317,7 @@ def setup_account():
|
||||
frappe.flags.in_import = False
|
||||
|
||||
def setup_account_to_expense_type():
|
||||
company_abbr = frappe.db.get_value("Company", erpnext.get_default_company(), "abbr")
|
||||
company_abbr = frappe.get_cached_value('Company', erpnext.get_default_company(), "abbr")
|
||||
expense_types = [{'name': _('Calls'), "account": "Sales Expenses - "+ company_abbr},
|
||||
{'name': _('Food'), "account": "Entertainment Expenses - "+ company_abbr},
|
||||
{'name': _('Medical'), "account": "Utility Expenses - "+ company_abbr},
|
||||
@@ -354,7 +354,7 @@ def setup_budget():
|
||||
budget.submit()
|
||||
|
||||
def setup_pos_profile():
|
||||
company_abbr = frappe.db.get_value("Company", erpnext.get_default_company(), "abbr")
|
||||
company_abbr = frappe.get_cached_value('Company', erpnext.get_default_company(), "abbr")
|
||||
pos = frappe.new_doc('POS Profile')
|
||||
pos.user = frappe.db.get_global('demo_accounts_user')
|
||||
pos.pos_profile_name = "Demo POS Profile"
|
||||
|
||||
@@ -28,7 +28,7 @@ def work():
|
||||
si.posting_date = frappe.flags.current_date
|
||||
for d in si.get("items"):
|
||||
if not d.income_account:
|
||||
d.income_account = "Sales - {}".format(frappe.db.get_value('Company', si.company, 'abbr'))
|
||||
d.income_account = "Sales - {}".format(frappe.get_cached_value('Company', si.company, 'abbr'))
|
||||
si.insert()
|
||||
si.submit()
|
||||
frappe.db.commit()
|
||||
@@ -106,7 +106,7 @@ def make_pos_invoice():
|
||||
si.posting_date = frappe.flags.current_date
|
||||
for d in si.get("items"):
|
||||
if not d.income_account:
|
||||
d.income_account = "Sales - {}".format(frappe.db.get_value('Company', si.company, 'abbr'))
|
||||
d.income_account = "Sales - {}".format(frappe.get_cached_value('Company', si.company, 'abbr'))
|
||||
si.set_missing_values()
|
||||
make_payment_entries_for_pos_invoice(si)
|
||||
si.insert()
|
||||
|
||||
@@ -51,12 +51,12 @@ def enroll_random_student(current_date):
|
||||
|
||||
def assign_student_group(student, student_name, program, courses, batch):
|
||||
course_list = [d["course"] for d in courses]
|
||||
for d in frappe.get_list("Student Group", fields=("name"), filters={"program": program, "course":("in", course_list)}):
|
||||
for d in frappe.get_list("Student Group", fields=("name"), filters={"program": program, "course":("in", course_list), "disabled": 0}):
|
||||
student_group = frappe.get_doc("Student Group", d.name)
|
||||
student_group.append("students", {"student": student, "student_name": student_name,
|
||||
"group_roll_number":len(student_group.students)+1, "active":1})
|
||||
student_group.save()
|
||||
student_batch = frappe.get_list("Student Group", fields=("name"), filters={"program": program, "group_based_on":"Batch", "batch":batch})[0]
|
||||
student_batch = frappe.get_list("Student Group", fields=("name"), filters={"program": program, "group_based_on":"Batch", "batch":batch, "disabled": 0})[0]
|
||||
student_batch_doc = frappe.get_doc("Student Group", student_batch.name)
|
||||
student_batch_doc.append("students", {"student": student, "student_name": student_name,
|
||||
"group_roll_number":len(student_batch_doc.students)+1, "active":1})
|
||||
@@ -65,7 +65,7 @@ def assign_student_group(student, student_name, program, courses, batch):
|
||||
|
||||
def mark_student_attendance(current_date):
|
||||
status = ["Present", "Absent"]
|
||||
for d in frappe.db.get_list("Student Group", filters={"group_based_on": "Batch"}):
|
||||
for d in frappe.db.get_list("Student Group", filters={"group_based_on": "Batch", "disabled": 0}):
|
||||
students = get_student_group_students(d.name)
|
||||
for stud in students:
|
||||
make_attendance_records(stud.student, stud.student_name, status[weighted_choice([9,4])], None, d.name, current_date)
|
||||
@@ -77,7 +77,7 @@ def make_fees():
|
||||
|
||||
def make_assessment_plan(date):
|
||||
for d in range(1,4):
|
||||
random_group = get_random("Student Group", {"group_based_on": "Course"}, True)
|
||||
random_group = get_random("Student Group", {"group_based_on": "Course", "disabled": 0}, True)
|
||||
doc = frappe.new_doc("Assessment Plan")
|
||||
doc.student_group = random_group.name
|
||||
doc.course = random_group.course
|
||||
|
||||
@@ -78,7 +78,7 @@ def make_stock_entry_from_pro(pro_id, purpose):
|
||||
st.posting_date = frappe.flags.current_date
|
||||
st.fiscal_year = str(frappe.flags.current_date.year)
|
||||
for d in st.get("items"):
|
||||
d.cost_center = "Main - " + frappe.db.get_value('Company', st.company, 'abbr')
|
||||
d.cost_center = "Main - " + frappe.get_cached_value('Company', st.company, 'abbr')
|
||||
st.insert()
|
||||
frappe.db.commit()
|
||||
st.submit()
|
||||
|
||||
@@ -51,7 +51,7 @@ def work():
|
||||
# get supplier details
|
||||
supplier = get_random("Supplier")
|
||||
|
||||
company_currency = frappe.db.get_value("Company", "Wind Power LLC", "default_currency")
|
||||
company_currency = frappe.get_cached_value('Company', "Wind Power LLC", "default_currency")
|
||||
party_account_currency = get_party_account_currency("Supplier", supplier, "Wind Power LLC")
|
||||
if company_currency == party_account_currency:
|
||||
exchange_rate = 1
|
||||
|
||||
@@ -84,7 +84,7 @@ def make_quotation():
|
||||
# get customer, currency and exchange_rate
|
||||
customer = get_random("Customer")
|
||||
|
||||
company_currency = frappe.db.get_value("Company", "Wind Power LLC", "default_currency")
|
||||
company_currency = frappe.get_cached_value('Company', "Wind Power LLC", "default_currency")
|
||||
party_account_currency = get_party_account_currency("Customer", customer, "Wind Power LLC")
|
||||
if company_currency == party_account_currency:
|
||||
exchange_rate = 1
|
||||
|
||||
@@ -55,7 +55,7 @@ def make_delivery_note():
|
||||
for d in dn.get("items"):
|
||||
if not d.expense_account:
|
||||
d.expense_account = ("Cost of Goods Sold - {0}".format(
|
||||
frappe.db.get_value('Company', dn.company, 'abbr')))
|
||||
frappe.get_cached_value('Company', dn.company, 'abbr')))
|
||||
dn.insert()
|
||||
try:
|
||||
dn.submit()
|
||||
|
||||
Reference in New Issue
Block a user