mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
Attachments fix (#528)
* Bump version * Fix for viewing and uploading attachment files - Make sure we use the correct attribute!
This commit is contained in:
parent
82aace9cc4
commit
c52885fc6b
4 changed files with 27 additions and 7 deletions
|
|
@ -1001,11 +1001,23 @@ class InvenTreeAttachment extends InvenTreeModel {
|
|||
String url = URL;
|
||||
|
||||
if (InvenTreeAPI().supportsModernAttachments) {
|
||||
// All attachments are stored in a consolidated table
|
||||
|
||||
if (modelType.isEmpty) {
|
||||
sentryReportMessage("uploadAttachment called with empty 'modelType'");
|
||||
return false;
|
||||
}
|
||||
|
||||
url = "attachment/";
|
||||
data["model_id"] = modelId.toString();
|
||||
data["model_type"] = modelType;
|
||||
|
||||
} else {
|
||||
|
||||
if (REFERENCE_FIELD.isEmpty) {
|
||||
sentryReportMessage("uploadAttachment called with empty 'REFERENCE_FIELD'");
|
||||
return false;
|
||||
}
|
||||
|
||||
data[REFERENCE_FIELD] = modelId.toString();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue