Skip to content
Snippets Groups Projects
Commit a6a425fd authored by Krishnakant Mane's avatar Krishnakant Mane
Browse files

Merge branch 'productgk' into 'devel'

Prevented redundancy in product get for godownkeeper

When a list of product codes is created in api_product.py for godown keeper a productcode was being added in every pass of loop.  
Now a condition checks if the productcode is already available and appends it to list only if it is not.

See merge request !10
parents 3ac1030f 22d42277
Branches
No related merge requests found
......@@ -81,7 +81,8 @@ class api_product(object):
proCode = self.con.execute(select([gkdb.goprod.c.productcode]).where(gkdb.goprod.c.goid==record2))
proCodes = proCode.fetchall()
for record3 in proCodes:
productCodes.append(record3["productcode"])
if record3["productcode"] not in productCodes:
productCodes.append(record3["productcode"])
results = []
for record4 in productCodes:
result = self.con.execute(select([gkdb.product.c.productcode, gkdb.product.c.productdesc, gkdb.product.c.categorycode, gkdb.product.c.uomid,gkdb.product.c.gsflag]).where(and_(gkdb.product.c.orgcode==authDetails["orgcode"], gkdb.product.c.productcode==record4)).order_by(gkdb.product.c.productdesc))
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment