[fix] [minor] test cases fixes
This commit is contained in:
parent
60ae96d588
commit
b0a1b3ab47
@ -34,7 +34,7 @@ class DocType(AccountsController):
|
|||||||
|
|
||||||
def validate_posting_date(self):
|
def validate_posting_date(self):
|
||||||
from accounts.utils import get_fiscal_year
|
from accounts.utils import get_fiscal_year
|
||||||
self.year_start_date = get_fiscal_year(self.doc.posting_date)[1]
|
self.year_start_date = get_fiscal_year(self.doc.posting_date, self.doc.fiscal_year)[1]
|
||||||
|
|
||||||
pce = webnotes.conn.sql("""select name from `tabPeriod Closing Voucher`
|
pce = webnotes.conn.sql("""select name from `tabPeriod Closing Voucher`
|
||||||
where posting_date > %s and fiscal_year = %s and docstatus = 1""",
|
where posting_date > %s and fiscal_year = %s and docstatus = 1""",
|
||||||
|
@ -13,5 +13,11 @@ test_records = [
|
|||||||
"from_currency": "USD",
|
"from_currency": "USD",
|
||||||
"to_currency": "EUR",
|
"to_currency": "EUR",
|
||||||
"exchange_rate": 0.773
|
"exchange_rate": 0.773
|
||||||
}]
|
}],
|
||||||
|
[{
|
||||||
|
"doctype": "Currency Exchange",
|
||||||
|
"from_currency": "INR",
|
||||||
|
"to_currency": "USD",
|
||||||
|
"exchange_rate": 0.0167
|
||||||
|
}],
|
||||||
]
|
]
|
@ -299,6 +299,8 @@ def create_material_request(material_requests):
|
|||||||
mr_list = []
|
mr_list = []
|
||||||
defaults = webnotes.defaults.get_defaults()
|
defaults = webnotes.defaults.get_defaults()
|
||||||
exceptions_list = []
|
exceptions_list = []
|
||||||
|
from accounts.utils import get_fiscal_year
|
||||||
|
current_fiscal_year = get_fiscal_year(nowdate())[0] or defaults.fiscal_year
|
||||||
for request_type in material_requests:
|
for request_type in material_requests:
|
||||||
for company in material_requests[request_type]:
|
for company in material_requests[request_type]:
|
||||||
try:
|
try:
|
||||||
@ -309,7 +311,7 @@ def create_material_request(material_requests):
|
|||||||
mr = [{
|
mr = [{
|
||||||
"doctype": "Material Request",
|
"doctype": "Material Request",
|
||||||
"company": company,
|
"company": company,
|
||||||
"fiscal_year": defaults.fiscal_year,
|
"fiscal_year": current_fiscal_year,
|
||||||
"transaction_date": nowdate(),
|
"transaction_date": nowdate(),
|
||||||
"material_request_type": request_type
|
"material_request_type": request_type
|
||||||
}]
|
}]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user