[fixes] check group condition
This commit is contained in:
parent
7fecb50360
commit
78333c7e07
@ -99,7 +99,7 @@ def validate_account_for_auto_accounting_for_stock(gl_map):
|
|||||||
if cint(frappe.db.get_single_value("Accounts Settings", "auto_accounting_for_stock")) \
|
if cint(frappe.db.get_single_value("Accounts Settings", "auto_accounting_for_stock")) \
|
||||||
and gl_map[0].voucher_type=="Journal Entry":
|
and gl_map[0].voucher_type=="Journal Entry":
|
||||||
aii_accounts = [d[0] for d in frappe.db.sql("""select name from tabAccount
|
aii_accounts = [d[0] for d in frappe.db.sql("""select name from tabAccount
|
||||||
where account_type = 'Stock' and (warehouse != '' and warehouse is not null)""")]
|
where account_type = 'Stock' and (warehouse != '' and warehouse is not null) and is_group=0""")]
|
||||||
|
|
||||||
for entry in gl_map:
|
for entry in gl_map:
|
||||||
if entry.account in aii_accounts:
|
if entry.account in aii_accounts:
|
||||||
|
@ -318,7 +318,7 @@ def get_stock_and_account_difference(account_list=None, posting_date=None):
|
|||||||
difference = {}
|
difference = {}
|
||||||
|
|
||||||
account_warehouse = dict(frappe.db.sql("""select name, warehouse from tabAccount
|
account_warehouse = dict(frappe.db.sql("""select name, warehouse from tabAccount
|
||||||
where account_type = 'Stock' and (warehouse is not null and warehouse != '')
|
where account_type = 'Stock' and (warehouse is not null and warehouse != '') and is_group=0
|
||||||
and name in (%s)""" % ', '.join(['%s']*len(account_list)), account_list))
|
and name in (%s)""" % ', '.join(['%s']*len(account_list)), account_list))
|
||||||
|
|
||||||
for account, warehouse in account_warehouse.items():
|
for account, warehouse in account_warehouse.items():
|
||||||
|
@ -322,6 +322,6 @@ def get_warehouse_account():
|
|||||||
|
|
||||||
for d in frappe.db.sql("""select warehouse, name, account_currency from tabAccount
|
for d in frappe.db.sql("""select warehouse, name, account_currency from tabAccount
|
||||||
where account_type = 'Stock' and (warehouse is not null and warehouse != ''
|
where account_type = 'Stock' and (warehouse is not null and warehouse != ''
|
||||||
and is_group != 1)""", as_dict=1):
|
and is_group != 1) and is_group=0 """, as_dict=1):
|
||||||
warehouse_account.setdefault(d.warehouse, d)
|
warehouse_account.setdefault(d.warehouse, d)
|
||||||
return warehouse_account
|
return warehouse_account
|
||||||
|
@ -231,7 +231,8 @@ def reset_serial_no_status_and_warehouse(serial_nos=None):
|
|||||||
|
|
||||||
def repost_all_stock_vouchers():
|
def repost_all_stock_vouchers():
|
||||||
warehouses_with_account = frappe.db.sql_list("""select master_name from tabAccount
|
warehouses_with_account = frappe.db.sql_list("""select master_name from tabAccount
|
||||||
where ifnull(account_type, '') = 'Stock' and (warehouse is not null and warehouse != '') """)
|
where ifnull(account_type, '') = 'Stock' and (warehouse is not null and warehouse != '')
|
||||||
|
and is_group=0""")
|
||||||
|
|
||||||
vouchers = frappe.db.sql("""select distinct voucher_type, voucher_no
|
vouchers = frappe.db.sql("""select distinct voucher_type, voucher_no
|
||||||
from `tabStock Ledger Entry` sle
|
from `tabStock Ledger Entry` sle
|
||||||
|
Loading…
x
Reference in New Issue
Block a user