[fix] warehouse test cases
This commit is contained in:
parent
6695830f3f
commit
ffd80a6061
@ -3,7 +3,7 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe.utils import cint, flt, cstr, now
|
||||
from frappe.utils import cint, flt, cstr
|
||||
from frappe import msgprint, _
|
||||
import frappe.defaults
|
||||
from erpnext.accounts.utils import get_fiscal_year
|
||||
@ -364,13 +364,18 @@ def get_voucherwise_gl_entries(future_stock_vouchers, posting_date):
|
||||
return gl_entries
|
||||
|
||||
def get_warehouse_account():
|
||||
if not frappe.flags.warehouse_account_map:
|
||||
if not frappe.flags.warehouse_account_map or frappe.flags.in_test:
|
||||
warehouse_account = frappe._dict()
|
||||
|
||||
for d in frappe.db.sql("""select warehouse, name, account_currency from tabAccount
|
||||
where account_type = 'Stock' and (warehouse is not null and warehouse != ''
|
||||
and is_group != 1) and is_group=0 """, as_dict=1):
|
||||
warehouse_account.setdefault(d.warehouse, d)
|
||||
for d in frappe.db.sql("""select
|
||||
warehouse, name, account_currency
|
||||
from
|
||||
tabAccount
|
||||
where
|
||||
account_type = 'Stock'
|
||||
and (warehouse is not null and warehouse != '')
|
||||
and is_group=0 """, as_dict=1):
|
||||
warehouse_account.setdefault(d.warehouse, d)
|
||||
|
||||
frappe.flags.warehouse_account_map = warehouse_account
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user