Replace item dialogs with Popups for better integration

This commit is contained in:
Cole Deck
2024-12-20 23:41:19 +00:00
parent 27169ff8a0
commit b1c817432b
4 changed files with 254 additions and 283 deletions

View File

@@ -82,7 +82,7 @@ def init():
db.create_tables([location, office, item, component, user])
print("Database initialized.")
global search
print("Creating cache index...")
print("Creating cache index... ", end='', flush=True)
search = ivs()
add = item.select().dicts()
#print(add)
@@ -92,9 +92,10 @@ def init():
itm["location"] = item.select().where(item.barcode==itm["barcode"])[0].loc.name
except:
pass
print(itm)
#print(itm)
#print(type(itm))
search.add_document(itm)
print(len(add))
print("Cache build complete.")
def search_item(query, filters: dict={}):
@@ -128,7 +129,7 @@ def find_item(barcode):
def find_item_location(barcode):
try:
return item.select().where(item.barcode==barcode).loc
return item.select().where(item.barcode==barcode)[0].loc
except:
return False
@@ -311,11 +312,11 @@ def get_location(name, parent=None):
def get_location_id(barcode):
try:
print("str" + barcode + "str")
#print("str" + barcode + "str")
if len(barcode) > 0:
query = location.select()
for loc in query:
print(loc.name, loc.locationid)
#print(loc.name, loc.locationid)
if loc.locationid == barcode:
return loc
return False