Skip to content

[19.0][FIX] dms: Fix upload file process - #528

Merged
OCA-git-bot merged 1 commit into
OCA:19.0from
Tecnativa:19.0-fix-dms-issue-pr-517
Oct 20, 2026
Merged

OCA-git-bot merged 1 commit into
OCA:19.0from
Tecnativa:19.0-fix-dms-issue-pr-517

Conversation

@victoralmau

Copy link
Copy Markdown
Member

Fix upload file process

Related to #517 (review)

Please @carlos-lopez-tecnativa can you review it?

@Tecnativa

@victoralmau
victoralmau force-pushed the 19.0-fix-dms-issue-pr-517 branch from 27f4cd0 to 9a64716 Compare October 19, 2026 08:23
@pedrobaeza pedrobaeza added this to the 19.0 milestone Oct 19, 2026

@carlos-lopez-tecnativa carlos-lopez-tecnativa left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I don't get the traceback anymore, but when I try to upload a file to a folder whose storage is attachment, the message A file must have model and resource ID in attachment storage is displayed.
How can I upload a file to this folder? Or what is the purpose of these folder/storage types?
Please clarify, because if I try to set res_id, the field is read-only. I'm not sure I understand this flow.

2026-10-20.08-45-56.mp4

Something similar happens when I try to create a new subfolder inside a folder that uses attachment as its storage type: I can't create the folder, and I can't set res_id either.

I can only upload files if I go to a record of this model (res.partner in the example) and attach a file there. At that moment, a new folder with the res_id is created automatically. I understand this is the expected flow, but in that case, the New and Upload buttons in the Documents kanban view should be disabled when the storage type is attachment and the folder doesn't have a res_model and res_id. This would prevent users from trying to upload files when it's not allowed.

2026-10-20.08-55-03.mp4

@victoralmau

Copy link
Copy Markdown
Member Author

We have already clarified internally the reason for the behavior you describe: it is “intentional” that you cannot create directories linked to a record for UX reasons; they will be created automatically when an attachment linked to that record is created (for example, in a partner).
From that point on, you will be able to add files (dms.file) to the partner's directory, and attachment (ir.attachment) will be created automatically.

@pedrobaeza

Copy link
Copy Markdown
Member

/ocabot merge patch

@OCA-git-bot

Copy link
Copy Markdown
Contributor

On my way to merge this fine PR!
Prepared branch 19.0-ocabot-merge-pr-528-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit b570158 into OCA:19.0 Oct 20, 2026
5 of 7 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at 7b510bd. Thanks a lot for contributing to OCA. ❤️

@pedrobaeza
pedrobaeza deleted the 19.0-fix-dms-issue-pr-517 branch October 20, 2026 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants