many changes
This commit is contained in:
@@ -30,7 +30,7 @@ class AddLocationPage(rio.Component):
|
||||
if get_location_id(self.parent) != False:
|
||||
self.parent_code = self.parent
|
||||
print("Found location " + get_location_id(self.parent).name)
|
||||
self.parent = get_location_id(self.parent).name
|
||||
self.parent = '*' + get_location_id(self.parent).name
|
||||
|
||||
async def add_part(self):
|
||||
if self.code == "":
|
||||
@@ -88,16 +88,19 @@ class AddLocationPage(rio.Component):
|
||||
),
|
||||
rio.TextInput(
|
||||
label="Barcode",
|
||||
text=self.bind().code
|
||||
text=self.bind().code,
|
||||
on_confirm=self._add_part_enter
|
||||
),
|
||||
rio.TextInput(
|
||||
label="Parent Location (optional)",
|
||||
text=self.bind().parent,
|
||||
on_change=self._update_location
|
||||
on_change=self._update_location,
|
||||
on_confirm=self._add_part_enter
|
||||
),
|
||||
rio.TextInput(
|
||||
label="Location Name",
|
||||
text=self.bind().name
|
||||
text=self.bind().name,
|
||||
on_confirm=self._add_part_enter
|
||||
),
|
||||
rio.MultiLineTextInput(
|
||||
label="Description (optional)",
|
||||
|
@@ -81,8 +81,11 @@ class AddPage(rio.Component):
|
||||
self.popup_message = "\n Duplicate barcode! \n\n"
|
||||
self.popup_show = True
|
||||
self.popup_color = 'warning'
|
||||
await asyncio.sleep(2)
|
||||
await asyncio.sleep(5)
|
||||
self.popup_show = False
|
||||
self.session.navigate_to("/")
|
||||
await asyncio.sleep(0.01)
|
||||
self.session.navigate_to("/add")
|
||||
else:
|
||||
self.popup_message = "\n Part added! \n\n"
|
||||
self.popup_show = True
|
||||
@@ -99,8 +102,12 @@ class AddPage(rio.Component):
|
||||
self.description: str = ""
|
||||
self.location: str = ""
|
||||
self.location_code: str = ""
|
||||
await asyncio.sleep(2)
|
||||
await asyncio.sleep(1)
|
||||
self.session.navigate_to("/")
|
||||
await asyncio.sleep(0.01)
|
||||
self.session.navigate_to("/add")
|
||||
self.popup_show = False
|
||||
#self.session.navigate_to("/add",replace=True)
|
||||
|
||||
|
||||
async def _add_part_enter(self, event: rio.TextInputConfirmEvent):
|
||||
@@ -134,7 +141,7 @@ class AddPage(rio.Component):
|
||||
if get_location_id(self.location) != False:
|
||||
self.location_code = self.location
|
||||
print("Found location " + get_location_id(self.location).name)
|
||||
self.location = get_location_id(self.location).name
|
||||
self.location = '*' + get_location_id(self.location).name
|
||||
|
||||
|
||||
def _update_partnum(self, event: rio.TextInputChangeEvent):
|
||||
@@ -230,7 +237,8 @@ class AddPage(rio.Component):
|
||||
),
|
||||
rio.TextInput(
|
||||
label="Barcode",
|
||||
text=self.bind().code
|
||||
text=self.bind().code,
|
||||
auto_focus=True
|
||||
),
|
||||
rio.TextInput(
|
||||
label="Full part number",
|
||||
|
@@ -146,7 +146,7 @@ class BrowsePage(rio.Component):
|
||||
self.edit_show = False
|
||||
self.info_show = True
|
||||
self.force_refresh()
|
||||
await delete_item_id(self.ibarcode)
|
||||
delete_item_id(self.ibarcode)
|
||||
await self._search()
|
||||
await asyncio.sleep(1)
|
||||
self.popup_show = False
|
||||
@@ -230,7 +230,7 @@ class BrowsePage(rio.Component):
|
||||
if get_location_id(self.elocation) != False:
|
||||
self.elocation_code = self.elocation
|
||||
print("Found location " + get_location_id(self.elocation).name)
|
||||
self.elocation = get_location_id(self.elocation).name
|
||||
self.elocation = '*' + get_location_id(self.elocation).name
|
||||
|
||||
def build(self) -> rio.Component:
|
||||
searchview: rio.ListView = rio.ListView(grow_y=True)
|
||||
|
Reference in New Issue
Block a user