[15.0][MIG] attachment_preview: Migration to version 15.0 - #363
Conversation
In order to get visibility on https://www.odoo.com/apps the OCA board has decided to add the OCA as author of all the addons maintained as part of the association.
[FIX] Lint [FIX] lint and flake [ADD] tests [ADD] tests [ADD] tests [ADD] Tests [ADD] Package python-magic [ADD] Tests [FIX] Lint
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: knowledge-11.0/knowledge-11.0-attachment_preview Translate-URL: https://translation.odoo-community.org/projects/knowledge-11-0/knowledge-11-0-attachment_preview/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: knowledge-11.0/knowledge-11.0-attachment_preview Translate-URL: https://translation.odoo-community.org/projects/knowledge-11-0/knowledge-11-0-attachment_preview/
[REM] Old files [ADD] Magic to travis file [FIX] Nagivation refresh widget
17f2537 to
0bce1f3
Compare
@HolgerNahrstaedt I just adjusted your suggestion |
|
/ocabot migration attachment_preview |
|
@HolgerNahrstaedt Can you update your review? |
|
This PR has the |
HolgerNahrstaedt
left a comment
There was a problem hiding this comment.
Please see my suggestions with code examples. The change regarding the python code is ok.
| $target = $(event.currentTarget), | ||
| split_screen = $target.attr("data-target") !== "new", | ||
| attachment_id = this.attachment.id, | ||
| attachment_extension = "pdf", |
There was a problem hiding this comment.
This should be removed and a get_attachment_extension rpc call should be used instead.
There was a problem hiding this comment.
@HolgerNahrstaedt we still need the variables split_screen, attachment_id as the input for the rpc request. But you are right with the attachment_extension. It is unnecessary here, so I removed it per your suggestion.
| attachment_url = this.attachment.defaultSource; | ||
| active_attachment_id = attachment_id; | ||
|
|
||
| if (attachment_extension) { |
There was a problem hiding this comment.
The if else path Lines 250 to 272 can be replaced by:
rpc.query({
model: "ir.attachment",
method: "get_attachment_extension",
args: [attachment_id],
}).then(function (extension) {
self._showPreview(
attachment_id,
attachment_url,
attachment_extension,
extension,
attachment_title,
split_screen
);
});
| attachment_url, | ||
| attachment_extension, | ||
| attachment_title | ||
| ); |
There was a problem hiding this comment.
A check if the extensions can be preview should be added
if (!canPreview(attachment_extension))
{
return;
}
| > | ||
| <div | ||
| t-if="attachmentCard.attachment.downloadUrl" | ||
| class="o_AttachmentCard_asideItem d-flex justify-content-center align-items-center ml4 o_attachment_preview" |
There was a problem hiding this comment.
o_attachment_preview should be removed here
| </div> | ||
| <div | ||
| t-if="attachmentCard.attachment.downloadUrl" | ||
| class="o_AttachmentCard_asideItem d-flex justify-content-center align-items-center ml4 o_attachment_preview o_attachment_preview_new_tab" |
There was a problem hiding this comment.
o_attachment_preview should be removed here
…_attachment_preview
HolgerNahrstaedt
left a comment
There was a problem hiding this comment.
Sorry for the confusion, wrong account.
The changes look now good to me. Great work!
|
/ocabot merge nobump |
|
Hey, thanks for contributing! Proceeding to merge this for you. |
|
Congratulations, your PR was merged at 2429966. Thanks a lot for contributing to OCA. ❤️ |
[15.0][MIG]attachment_preview