[fix] for setup wizard tests and demo;
This commit is contained in:
parent
2b5fa7647a
commit
cf99dc0e77
@ -46,8 +46,7 @@ def complete_setup(domain='Manufacturing'):
|
|||||||
|
|
||||||
if not frappe.get_all('Company', limit=1):
|
if not frappe.get_all('Company', limit=1):
|
||||||
setup_complete({
|
setup_complete({
|
||||||
"first_name": "Test",
|
"full_name": "Test User",
|
||||||
"last_name": "User",
|
|
||||||
"email": "test_demo@erpnext.com",
|
"email": "test_demo@erpnext.com",
|
||||||
"company_tagline": 'Awesome Products and Services',
|
"company_tagline": 'Awesome Products and Services',
|
||||||
"password": "demo",
|
"password": "demo",
|
||||||
|
|||||||
@ -13,7 +13,7 @@ args = {
|
|||||||
"customer_2": "Mahesh Engg",
|
"customer_2": "Mahesh Engg",
|
||||||
"customer_contact_1": "Aditya Duggal",
|
"customer_contact_1": "Aditya Duggal",
|
||||||
"customer_contact_2": "Mahesh Malani",
|
"customer_contact_2": "Mahesh Malani",
|
||||||
"first_name": "Rushabh",
|
"full_name": "Rushabh Mehta",
|
||||||
"fy_start": "1st Apr",
|
"fy_start": "1st Apr",
|
||||||
"item_1": "Enterprise Plan",
|
"item_1": "Enterprise Plan",
|
||||||
"item_2": "Small Business",
|
"item_2": "Small Business",
|
||||||
@ -42,7 +42,6 @@ args = {
|
|||||||
"item_uom_3": "Unit",
|
"item_uom_3": "Unit",
|
||||||
"item_uom_4": "Unit",
|
"item_uom_4": "Unit",
|
||||||
"item_uom_5": "Unit",
|
"item_uom_5": "Unit",
|
||||||
"last_name": "Mehta",
|
|
||||||
"supplier_1": "Google",
|
"supplier_1": "Google",
|
||||||
"supplier_2": "Hetzner",
|
"supplier_2": "Hetzner",
|
||||||
"supplier_3": "Digital Ocean",
|
"supplier_3": "Digital Ocean",
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import frappe
|
|||||||
from frappe import _, throw
|
from frappe import _, throw
|
||||||
from frappe.utils import flt
|
from frappe.utils import flt
|
||||||
from frappe.utils import get_datetime_str, nowdate
|
from frappe.utils import get_datetime_str, nowdate
|
||||||
|
|
||||||
def get_company_currency(company):
|
def get_company_currency(company):
|
||||||
currency = frappe.db.get_value("Company", company, "default_currency", cache=True)
|
currency = frappe.db.get_value("Company", company, "default_currency", cache=True)
|
||||||
if not currency:
|
if not currency:
|
||||||
@ -37,8 +37,7 @@ def before_tests():
|
|||||||
if not frappe.get_list("Company"):
|
if not frappe.get_list("Company"):
|
||||||
setup_complete({
|
setup_complete({
|
||||||
"currency" :"USD",
|
"currency" :"USD",
|
||||||
"first_name" :"Test",
|
"full_name" :"Test User",
|
||||||
"last_name" :"User",
|
|
||||||
"company_name" :"Wind Power LLC",
|
"company_name" :"Wind Power LLC",
|
||||||
"timezone" :"America/New_York",
|
"timezone" :"America/New_York",
|
||||||
"company_abbr" :"WP",
|
"company_abbr" :"WP",
|
||||||
@ -52,7 +51,7 @@ def before_tests():
|
|||||||
"password" :"test",
|
"password" :"test",
|
||||||
"chart_of_accounts" : "Standard",
|
"chart_of_accounts" : "Standard",
|
||||||
"domain" : "Manufacturing",
|
"domain" : "Manufacturing",
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
frappe.db.sql("delete from `tabLeave Allocation`")
|
frappe.db.sql("delete from `tabLeave Allocation`")
|
||||||
@ -71,18 +70,18 @@ def get_exchange_rate(from_currency, to_currency, transaction_date=None):
|
|||||||
if not (from_currency and to_currency):
|
if not (from_currency and to_currency):
|
||||||
# manqala 19/09/2016: Should this be an empty return or should it throw and exception?
|
# manqala 19/09/2016: Should this be an empty return or should it throw and exception?
|
||||||
return
|
return
|
||||||
|
|
||||||
if from_currency == to_currency:
|
if from_currency == to_currency:
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
# cksgb 19/09/2016: get last entry in Currency Exchange with from_currency and to_currency.
|
# cksgb 19/09/2016: get last entry in Currency Exchange with from_currency and to_currency.
|
||||||
entries = frappe.get_all("Currency Exchange", fields = ["exchange_rate"],
|
entries = frappe.get_all("Currency Exchange", fields = ["exchange_rate"],
|
||||||
filters=[
|
filters=[
|
||||||
["date", "<=", get_datetime_str(transaction_date)],
|
["date", "<=", get_datetime_str(transaction_date)],
|
||||||
["from_currency", "=", from_currency],
|
["from_currency", "=", from_currency],
|
||||||
["to_currency", "=", to_currency]
|
["to_currency", "=", to_currency]
|
||||||
], order_by="date desc", limit=1)
|
], order_by="date desc", limit=1)
|
||||||
|
|
||||||
if entries:
|
if entries:
|
||||||
return flt(entries[0].exchange_rate)
|
return flt(entries[0].exchange_rate)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user