fix: cleanup Land views to better match farmOS

This commit is contained in:
Lance Edgar 2026-02-14 20:21:42 -06:00
parent e60b91fd45
commit 71592e883a

View file

@ -39,12 +39,14 @@ class LandAssetView(WuttaFarmMasterView):
farmos_refurl_path = "/assets/land" farmos_refurl_path = "/assets/land"
labels = {
"name": "Asset Name",
}
grid_columns = [ grid_columns = [
"drupal_id",
"name", "name",
"land_type", "land_type",
"is_location",
"is_fixed",
"notes",
"archived", "archived",
] ]
@ -57,10 +59,11 @@ class LandAssetView(WuttaFarmMasterView):
form_fields = [ form_fields = [
"name", "name",
"notes",
"asset_type",
"land_type", "land_type",
"is_location", "is_location",
"is_fixed", "is_fixed",
"notes",
"archived", "archived",
"farmos_uuid", "farmos_uuid",
"drupal_id", "drupal_id",
@ -71,6 +74,9 @@ class LandAssetView(WuttaFarmMasterView):
super().configure_grid(g) super().configure_grid(g)
model = self.app.model model = self.app.model
# drupal_id
g.set_label("drupal_id", "ID", column_only=True)
# name # name
g.set_link("name") g.set_link("name")
@ -89,6 +95,16 @@ class LandAssetView(WuttaFarmMasterView):
f = form f = form
super().configure_form(f) super().configure_form(f)
# notes
f.set_widget("notes", "notes")
# asset_type
if self.creating:
f.remove("asset_type")
else:
f.set_default("asset_type", "Land")
f.set_readonly("asset_type")
# land_type # land_type
f.set_node("land_type", LandTypeRef(self.request)) f.set_node("land_type", LandTypeRef(self.request))