-
Notifications
You must be signed in to change notification settings - Fork 214
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
base: 12.0
Are you sure you want to change the base?
Conversation
d373948
to
7e78550
Compare
20f4787
to
397a6a3
Compare
Seems the CI is failling but unrelated to that PR
|
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. |
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. |
@yvaucher did you make the quick patch? |
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. |
# 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
super(IrAttachment, attach.sudo()).write(vals) | |
super(BaseIrAttachment, attach.sudo()).write(vals) |
397a6a3
to
b2028eb
Compare
add conditionnal mimetype to upload file in bucket s3