Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add conditionnal mimetype to upload file in bucket s3 #404

Open
wants to merge 1 commit into
base: 12.0
Choose a base branch
from

Conversation

cyrilmanuel
Copy link
Contributor

@cyrilmanuel cyrilmanuel commented Jan 25, 2023

add conditionnal mimetype to upload file in bucket s3

@cyrilmanuel cyrilmanuel changed the base branch from 16.0 to 12.0 January 25, 2023 10:31
@cyrilmanuel cyrilmanuel force-pushed the add-conditionnal-mimetype branch 2 times, most recently from d373948 to 7e78550 Compare January 26, 2023 10:59
@cyrilmanuel cyrilmanuel force-pushed the add-conditionnal-mimetype branch 3 times, most recently from 20f4787 to 397a6a3 Compare January 26, 2023 13:11
@yvaucher
Copy link
Member

Seems the CI is failling but unrelated to that PR

ERROR: Could not find a version that satisfies the requirement pylint-plugin-utils==0.7 (from -r /home/travis/maintainer-quality-tools/travis/pylint_odoo_requirements.txt (line 1)) (from versions: 0.1, 0.1.1, 0.2, 0.2.1, 0.2.2, 0.2.3, 0.2.4, 0.2.6, 0.3, 0.4, 0.5, 0.6)

@yvaucher
Copy link
Member

We should change the unit tests to be run with github actions.

MQT now fails due to a change on pylint-odoo that requires a dependency which is too recent and dropped support for python <3.6.2.

https://github.com/OCA/oca-addons-repo-template/tree/master/.github/workflows

I'll make a quick patch.

@github-actions
Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale label Jul 23, 2023
@gurneyalex
Copy link
Member

@yvaucher did you make the quick patch?

@github-actions github-actions bot removed the stale label Aug 13, 2023
Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale label Dec 17, 2023
@github-actions github-actions bot closed this Jan 21, 2024
@yvaucher yvaucher reopened this Nov 13, 2024
# take current location in filestore to possibly garbage-collect it
fname = attach.store_fname
# write as superuser, as user probably does not have write access
super(IrAttachment, attach.sudo()).write(vals)
Copy link
Member

@yvaucher yvaucher Nov 13, 2024

Choose a reason for hiding this comment

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

⚠️ With @sarsurgithub we discovered that this super is there to bypass the write of ir.attachment where it pops out the file_size and checksum fields as it is supposed to be written by this inverse function.

Thus here with this overwrite we loose this bypass.
➡️ As a result file_size and checksum are never written.

You need to import the base ir_attachment model:

from odoo.addons.base.models.ir_attachment import IrAttachment as BaseIrAttachment

Then use the base model for the write.

Suggested change
super(IrAttachment, attach.sudo()).write(vals)
super(BaseIrAttachment, attach.sudo()).write(vals)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants