fixed generic modal form error (merge conflict)

This commit is contained in:
vabene1111
2023-05-29 15:40:25 +02:00
parent a65e93a9b3
commit c0577abb89
3 changed files with 23 additions and 22 deletions

View File

@ -277,7 +277,7 @@
<i class="fas fa-database fa-2x"></i> <i class="fas fa-database fa-2x"></i>
</div> </div>
<div class="card-body text-break text-center p-0 no-gutters text-muted menu-dropdown-text"> <div class="card-body text-break text-center p-0 no-gutters text-muted menu-dropdown-text">
{% trans 'Food Properties' %} {% trans 'Properties' %}
</div> </div>
</div> </div>
</a> </a>

View File

@ -94,6 +94,7 @@ export default {
}, },
}, },
show: {required: true, type: Boolean, default: false}, show: {required: true, type: Boolean, default: false},
models: {required: false, type: Function, default: null}
}, },
data() { data() {
return { return {

View File

@ -600,10 +600,19 @@ export class Models {
}, },
}, },
create: { create: {
params: [['base_amount', 'base_unit', 'converted_amount', 'converted_unit', 'food', 'open_data_slug']], params: [['food', 'base_amount', 'base_unit', 'converted_amount', 'converted_unit', 'open_data_slug']],
form: { form: {
show_help: true, show_help: true,
// TODO add proper help texts for everything // TODO add proper help texts for everything
food: {
form_field: true,
type: "lookup",
field: "food",
list: "FOOD",
list_label: "name",
label: "Food",
multiple: false,
},
base_amount: { base_amount: {
form_field: true, form_field: true,
type: "text", type: "text",
@ -636,15 +645,6 @@ export class Models {
label: "converted_unit", label: "converted_unit",
multiple: false, multiple: false,
}, },
food: {
form_field: true,
type: "lookup",
field: "food",
list: "FOOD",
list_label: "name",
label: "Food",
multiple: false,
},
open_data_slug: { open_data_slug: {
form_field: true, form_field: true,
type: "text", type: "text",