Add a "notes" field

This commit is contained in:
Oliver 2021-07-11 20:56:29 +10:00
parent ca5d3a57de
commit 3efd7f7777
2 changed files with 12 additions and 4 deletions

View File

@ -395,10 +395,11 @@ function constructFormBody(fields, options) {
for (var name in displayed_fields) {
// Only push names which are actually in the set of fields
if (name in fields) {
field_names.push(name);
} else {
field_names.push(name);
// Field not specified in the API, but the client wishes to add it!
if (!(name in fields)) {
fields[name] = displayed_fields[name];
console.log(`WARNING: '${name}' does not match a valid field name.`);
}
}

View File

@ -162,6 +162,13 @@ function adjustStock(items, options={}) {
});
constructFormBody({}, {
fields: {
note: {
label: '{% trans "Notes" %}',
help_text: '{% trans "Stock transaction notes" %}',
type: 'string',
}
},
preFormContent: html,
confirm: true,
modal: modal,