[18.0][IMP] dms: Clean up attachments after creation of file - #470
Conversation
pedrobaeza
left a comment
There was a problem hiding this comment.
Why an attachment is created in first place?
|
@pedrobaeza It reuses |
|
Then isn't better to do the upload other way for not generating that garbage? |
|
@pedrobaeza I don't know if it's used for something, I assume there is / was a reason to use the endpoint. |
|
I don't think so apart from reducing the code in this part, but having that side effects, this is to be questioned. @victoralmau can you confirm? |
I see that this was added in v16 (#262), since there is already a method in the |
|
Yes, but as said, with this high side effect, I would switch again to have the complete upload handle here in this module instead of using the other, but generating the garbage. Maybe a part of the other code can be used without generating the attachment. |
Another approach: #472 |
|
Yes I agree if there's no reason but reducing code we should create a handler directly in DMS that doesn't create the attachment! |
Forward-port of 938f72d from 18.0 (Related to OCA#470). The upload flow now POSTs directly to a new `/web/binary/upload_dms_file` controller that creates the `dms.file` records, instead of round-tripping through `upload_attachment` + `get_dms_files_from_attachments` (both removed). 19.0 adaptations on top of the forward-port: - controller translation via `request.env._()` (not `_`). - dropped the `dms_field` portion of the original commit (separate module, not part of this PR). Co-authored-by: Víctor Martínez <victor.martinez@tecnativa.com>
Related to OCA#470 (comment) (cherry picked from commit 938f72d)
Related to OCA#470 (comment) (cherry picked from commit 938f72d)
Related to OCA#470 (comment) (cherry picked from commit 938f72d) Co-authored-by: Don Kendall <dkendall@ledoweb.com>
Related to OCA#470 (comment) (cherry picked from commit 938f72d) Co-authored-by: Don Kendall <dkendall@ledoweb.com>
Fixes: #468