-
-
Notifications
You must be signed in to change notification settings - Fork 165
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
[18.0][MIG] storage_file: Migration to 18.0 #434
[18.0][MIG] storage_file: Migration to 18.0 #434
Conversation
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.
Thanks!
f16bdd7
to
bfa8518
Compare
bfa8518
to
5dc012d
Compare
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.
Thanks for the updates!
storage_file/models/storage_file.py
Outdated
if record.data: | ||
raise UserError( | ||
self.env._( | ||
"File can not be updated," "remove it and create a new one" |
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.
"File can not be updated," "remove it and create a new one" | |
"File can not be updated, remove it and create a new one" |
storage_file/models/storage_file.py
Outdated
def _clean_storage_file(self): | ||
# we must be sure that all the changes are into the DB since | ||
# we by pass the ORM | ||
self.env.flush_all() |
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.
self.env.flush_all() | |
self.flush_model(["to_delete"]) |
nitpicking: this is actually more accurate
self.env[storage_file._name].with_user(public_user).browse( | ||
storage_file.ids | ||
).name | ||
_ = ( |
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.
Why are you assigning to _
?
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.
This is why I declared the variable unused for it: B018 Found useless attribute access. Either assign it to a variable or remove it.
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.
Oh, if it's just a linter rule, you can disable it it with an inline comment.
E.g.:
self.env[storage_file._name].with_user(public_user).browse(storage_file.ids).name # noqa: B018
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.
Thanks you, It doesn't work because it crossed the line when combined with pre-commit with max characters being 88 per line
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.
@thienvh332 Can you at least assign the value to a string starting with _
to avoid the warning but not to the character _
alone to avoid the confusion with the translation method _
.
This PR has the |
5dc012d
to
002bf64
Compare
self.env[storage_file._name].with_user(public_user).browse( | ||
storage_file.ids | ||
).name | ||
_ = ( |
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.
Oh, if it's just a linter rule, you can disable it it with an inline comment.
E.g.:
self.env[storage_file._name].with_user(public_user).browse(storage_file.ids).name # noqa: B018
c1aaba9
to
f8a649e
Compare
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.
Thank you for the migration. A little comment....
self.env[storage_file._name].with_user(public_user).browse( | ||
storage_file.ids | ||
).name | ||
_ = ( |
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.
@thienvh332 Can you at least assign the value to a string starting with _
to avoid the warning but not to the character _
alone to avoid the confusion with the translation method _
.
/ocabot migrate storage_file |
Hi @lmignon. Your command failed:
Ocabot commands
More information
|
/ocabot migration storage_file |
In some cases, is desirable to not have the CDN URL. Examples: - reduce payload of images metadata (URL is the same for all of them) - use same storage but different CDN URLs for different frontends
Copy will only work when using name_id strategy, when using checksum, it will fail, as the relative_path must be unique by storage
f8a649e
to
c3efaf7
Compare
/ocabot merge nobump |
/ocabot merge nobump |
On my way to merge this fine PR! |
Congratulations, your PR was merged at 9f65f0c. Thanks a lot for contributing to OCA. ❤️ |
No description provided.