food edit modal - reset children inheritance

This commit is contained in:
Chris Scoggins
2022-02-02 09:53:37 -06:00
parent a0508684d9
commit dcad389010
6 changed files with 40 additions and 20 deletions

View File

@ -76,7 +76,7 @@ export class Models {
// REQUIRED: unordered array of fields that can be set during create
create: {
// if not defined partialUpdate will use the same parameters, prepending 'id'
params: [["name", "description", "recipe", "food_onhand", "supermarket_category", "inherit", "inherit_fields", "ignore_shopping"]],
params: [["name", "description", "recipe", "food_onhand", "supermarket_category", "inherit", "inherit_fields", "ignore_shopping", "reset_inherit"]],
form: {
show_help: true,
@ -135,6 +135,14 @@ export class Models {
label: i18n.t("InheritFields"),
condition: { field: "food_children_exist", value: true, condition: "preference_equals" },
},
reset_inherit: {
form_field: true,
type: "checkbox",
field: "reset_inherit",
label: i18n.t("reset_children"),
help_text: i18n.t("reset_children_help"),
condition: { field: "numchild", value: 0, condition: "gt" },
},
form_function: "FoodCreateDefault",
},
},