Add delete function, fix some text
This commit is contained in:
		@@ -195,6 +195,11 @@ def update_item(fullname, serial, officename, barcode, locationid=None, descript
 | 
			
		||||
def delete_item(itm):
 | 
			
		||||
    #item.delete(itm)
 | 
			
		||||
    itm.delete_instance()
 | 
			
		||||
 | 
			
		||||
def delete_item_id(barcode):
 | 
			
		||||
    #item.delete(itm)
 | 
			
		||||
    itm = get_item(barcode)
 | 
			
		||||
    itm.delete_instance()
 | 
			
		||||
    
 | 
			
		||||
def item_location_str(itm):
 | 
			
		||||
    try:
 | 
			
		||||
 
 | 
			
		||||
@@ -16,9 +16,9 @@ class Footer(rio.Component):
 | 
			
		||||
    def build(self) -> rio.Component:
 | 
			
		||||
        return rio.Card(
 | 
			
		||||
            content=rio.Column(
 | 
			
		||||
                rio.Text("Buzzwordz Inc."),
 | 
			
		||||
                rio.Text("Validation Lab"),
 | 
			
		||||
                rio.Text(
 | 
			
		||||
                    "Hyper Dyper Website",
 | 
			
		||||
                    "Inventory Management system",
 | 
			
		||||
                    style="dim",
 | 
			
		||||
                ),
 | 
			
		||||
                spacing=1,
 | 
			
		||||
 
 | 
			
		||||
@@ -54,7 +54,7 @@ class AddLocationPage(rio.Component):
 | 
			
		||||
                await asyncio.sleep(2)
 | 
			
		||||
                self.popup_show = False
 | 
			
		||||
            else:
 | 
			
		||||
                self.popup_message = "\n  Part added!  \n\n"
 | 
			
		||||
                self.popup_message = "\n  Location added!  \n\n"
 | 
			
		||||
                self.popup_show = True
 | 
			
		||||
                self.popup_color = 'success'
 | 
			
		||||
                self.name: str = ""
 | 
			
		||||
@@ -76,7 +76,7 @@ class AddLocationPage(rio.Component):
 | 
			
		||||
        return rio.Column(
 | 
			
		||||
            rio.Popup(
 | 
			
		||||
                anchor=rio.Text(
 | 
			
		||||
                    text="Add a part below:",
 | 
			
		||||
                    text="Add a location below:",
 | 
			
		||||
                    style='heading1',
 | 
			
		||||
                    align_x = 0.5
 | 
			
		||||
                ),
 | 
			
		||||
 
 | 
			
		||||
@@ -130,9 +130,13 @@ class BrowsePage(rio.Component):
 | 
			
		||||
 | 
			
		||||
    async def _delete_edit_popup(self):
 | 
			
		||||
        self.edit_show = False
 | 
			
		||||
        self.info_show = False
 | 
			
		||||
        # TODO: delete here
 | 
			
		||||
        self.info_show = True
 | 
			
		||||
        await self.force_refresh()
 | 
			
		||||
        await delete_item_id(self.ibarcode)
 | 
			
		||||
        await self._search()
 | 
			
		||||
        await asyncio.sleep(1)
 | 
			
		||||
        self.popup_show = False
 | 
			
		||||
        await self._search()
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    async def _open_edit_popup(self, code: str) -> str | None:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user