Skip to content
Snippets Groups Projects
Commit 5bca3edf14ac authored by Houzefa Abbasbhay's avatar Houzefa Abbasbhay :slight_smile:
Browse files

Improve when wrapping an existing attachment

parent 4e488c22f7ee
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,10 @@
- Associate the new attachment with the current object.
"""
# When wrapping an existing attachment, no need to pre-fill data.
if vals.get("file_id"):
return super(DocumentAttachment, self).create(vals)
context = self._context
if "res_model" not in context:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment