2022-07-19 09:59:00 +00:00
|
|
|
from ui.crud import Crud, Json_External_Dialog_Editor_Cell_Widget
|
|
|
|
|
from ui.recipe_spec_editor import Recipe_Spec_Editor
|
|
|
|
|
from ui.widget import Widget
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Recipes_Management(Widget):
|
|
|
|
|
def __init__(self):
|
|
|
|
|
super().__init__()
|
|
|
|
|
crud_aliases = {
|
|
|
|
|
"id": "Id",
|
|
|
|
|
"name": "Ricetta",
|
|
|
|
|
"client": "Cliente",
|
|
|
|
|
"part_number": "N° disegno",
|
|
|
|
|
"spec": "Specifica",
|
|
|
|
|
"description": "Desccrizione",
|
|
|
|
|
"archived": "Archiviata",
|
|
|
|
|
}
|
|
|
|
|
self.crud = Crud(
|
|
|
|
|
"recipes",
|
|
|
|
|
display_name="GESTIONE RICETTE",
|
|
|
|
|
readonly=["id"],
|
|
|
|
|
select=list(crud_aliases.keys()),
|
|
|
|
|
fields_aliases=crud_aliases,
|
|
|
|
|
autocomplete={
|
|
|
|
|
"archived": False,
|
|
|
|
|
},
|
2022-07-26 10:24:53 +00:00
|
|
|
widget_classes={"spec": lambda *args, **kwargs: Json_External_Dialog_Editor_Cell_Widget(Recipe_Spec_Editor, *args, **kwargs), },
|
2022-07-19 09:59:00 +00:00
|
|
|
)
|
|
|
|
|
self.layout().addWidget(self.crud, 0, 0, -1, -1)
|