[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): 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 = "" 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 from `tabStock Ledger Entry` sle
where timestamp(sle.posting_date, sle.posting_time) >= timestamp(%s, %s) %s where timestamp(sle.posting_date, sle.posting_time) >= timestamp(%s, %s) {condition}
order by timestamp(sle.posting_date, sle.posting_time) asc, name asc""" % order by timestamp(sle.posting_date, sle.posting_time) asc, name asc""".format(
('%s', '%s', condition), (self.posting_date, self.posting_time), condition=condition), tuple([self.posting_date, self.posting_date] + item_list),
as_dict=True): as_list=True)
future_stock_vouchers.append([d.voucher_type, d.voucher_no])
return future_stock_vouchers return future_stock_vouchers

View File

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