Commit 4571c942 authored by Boris Kocherov's avatar Boris Kocherov

erp5_officejs: schema_editor: schema reference update if file uploaded

parent b9313a0c
...@@ -43,10 +43,11 @@ ...@@ -43,10 +43,11 @@
.push(function (content) { .push(function (content) {
var list = [], var list = [],
blob; blob;
if (content.data_file_upload) { if (content.file) {
blob = jIO.util.dataURItoBlob(content.data_file_upload.url); blob = jIO.util.dataURItoBlob(content.file.url);
content.title = content.data_file_upload.file_name; content.title = content.title || content.file.file_name;
delete content.data_file_upload; content.reference = content.reference || content.file.file_name;
delete content.file;
list = [ list = [
gadget.updateDocument(content), gadget.updateDocument(content),
gadget.jio_putAttachment(gadget.state.jio_key, 'data', blob) gadget.jio_putAttachment(gadget.state.jio_key, 'data', blob)
...@@ -124,7 +125,7 @@ ...@@ -124,7 +125,7 @@
"css_class": "", "css_class": "",
"required": 0, "required": 0,
"editable": 1, "editable": 1,
"key": "data_file_upload", "key": "file",
"hidden": 0, "hidden": 0,
"accept": "application/json", "accept": "application/json",
"type": "FileField" "type": "FileField"
...@@ -178,4 +179,4 @@ ...@@ -178,4 +179,4 @@
}); });
}); });
}); });
}(window, jIO, rJS, RSVP)); }(window, jIO, rJS, RSVP));
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment