[fix] Error Reports

This commit is contained in:
Anand Doshi 2014-08-19 12:20:48 +05:30
parent 5e893ef8fd
commit 78b6366325
2 changed files with 11 additions and 14 deletions

View File

@ -166,21 +166,19 @@ class StockController(AccountsController):
def get_future_stock_vouchers(self):
future_stock_vouchers = []
if hasattr(self, "fname"):
item_list = [d.item_code for d in self.get(self.fname)]
condition = ''.join(['and item_code in (\'', '\', \''.join(item_list) ,'\')'])
else:
condition = ""
item_list = []
if getattr(self, "fname", None):
item_list = [d.item_code for d in self.get(self.fname)]
if item_list:
condition = "and item_code in ({})".format(", ".join(["%s"] * len(item_list)))
for d in frappe.db.sql("""select distinct sle.voucher_type, sle.voucher_no
future_stock_vouchers = frappe.db.sql("""select distinct sle.voucher_type, sle.voucher_no
from `tabStock Ledger Entry` sle
where timestamp(sle.posting_date, sle.posting_time) >= timestamp(%s, %s) %s
order by timestamp(sle.posting_date, sle.posting_time) asc, name asc""" %
('%s', '%s', condition), (self.posting_date, self.posting_time),
as_dict=True):
future_stock_vouchers.append([d.voucher_type, d.voucher_no])
where timestamp(sle.posting_date, sle.posting_time) >= timestamp(%s, %s) {condition}
order by timestamp(sle.posting_date, sle.posting_time) asc, name asc""".format(
condition=condition), tuple([self.posting_date, self.posting_date] + item_list),
as_list=True)
return future_stock_vouchers

View File

@ -19,8 +19,7 @@ cur_frm.cscript.set_root_readonly = function(doc) {
//get query select Customer Group
cur_frm.fields_dict['parent_customer_group'].get_query = function(doc,cdt,cdn) {
return{
searchfield:['name', 'parent_customer_group'],
return {
filters: {
'is_group': "Yes"
}