-
-
Notifications
You must be signed in to change notification settings - Fork 796
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
[16.0][MIG] report_qweb_encrypt: Migration to 16.0 #779
[16.0][MIG] report_qweb_encrypt: Migration to 16.0 #779
Conversation
29f9feb
to
7ef5792
Compare
Hello @luisg123v, could you review this, please? |
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.
There is only one commit, you're not bringing commit history.
Please follow these instructions to bring commit history.
This is important, because otherwise:
- It's hard for reviewer to review the actuall migration changes
- Authorship for all existing changes is lost
report_qweb_encrypt/__manifest__.py
Outdated
"assets": { | ||
"web.assets_backend": [ | ||
"report_qweb_encrypt/static/src/js/report/action_manager_report.esm.js", | ||
"report_qweb_encrypt/static/src/js/report/encrypt_dialog.xml", |
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.
You're placing a XML file under the js directory.
I think what you should do instead is removing the js directory and place both files inside report, because, starting from OWL structure, files are not placed according to their languages but according to their purpose.
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.
I think this makes sense and is consistent with other modules' structures, I've corrected this, thanks!
report_qweb_encrypt/i18n/es.po
Outdated
msgstr "" | ||
"Project-Id-Version: Odoo Server 14.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"Last-Translator: Automatically generated\n" |
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.
Don't touch translation files.
You may regenerate pot file if you would like to. Both pot and po will be regenerated by the bot anyway.
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.
Fixed, thanks!
def _get_pdf_password(self, res_ids): | ||
encrypt_password = False | ||
if self.encrypt == "manual": | ||
encrypt_password = self._context.get("encrypt_password", False) |
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.
You're removing comments above this 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.
I originally deleted them because I believed they were no longer relevant, but they still are, so I've added the back, thanks
let url = `/report/${type}/${action.report_name}`; | ||
const actionContext = action.context || {}; | ||
const userContext = Object.assign(env.services.user.context, { | ||
encrypt_password: action.context.encrypt_password, |
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.
did you mean encrypted?
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.
No, encrypt_password
is the context key that points to the password that is fetched in the backend to encrypt the pdf - here:
encrypt_password = self._context.get("encrypt_password", False) |
so the name was intentional.
/ocabot migration report_qweb_encrypt |
Sorry @luisg123v you are not allowed to mark the addon tobe migrated. To do so you must either have push permissions on the repository, or be a declared maintainer of all modified addons. If you wish to adopt an addon and become it's maintainer, open a pull request to add your GitHub login to the |
/ocabot migration report_qweb_encrypt |
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: reporting-engine-15.0/reporting-engine-15.0-report_qweb_encrypt Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-15-0/reporting-engine-15-0-report_qweb_encrypt/
ca8b7bd
to
e953692
Compare
@luisg123v I've updated this PR, could you review again, please? |
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.
I noticed you brought commit history, you just missed one commit: 556e60b
except Exception as e: | ||
raise ValidationError( | ||
_("Python code used for encryption password is invalid.\n%s") | ||
% self.encrypt_password |
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.
Previous version was the correct one, you should use the lazy syntax:
_("...%s..", param)
Instead of:
_("...%s..") % param
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.
Done :)
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.
Done but in the incorrect commit, it's placed in the pre-commit commit
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.
I figured this was something "pre-commit-ish", so I placed it there, but I've moved it to the other commit, thanks!
requirements.txt
Outdated
@@ -1,4 +1,5 @@ | |||
# generated from manifests external_dependencies | |||
lxml | |||
PyPDF2 |
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.
Please remove this dependency from manifest, this is already considered by Odoo's requirements here.
Please take into account this requirements file is autogenerated from module's external dependencies. So, once you remove it from there, it should also be removed from here.
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.
Done :)
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.
Instead of adding it into the pre-commit commit to then removing it into the migration commit, just don't include 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.
That makes sense, I've updated the code, thanks!
Currently translated at 100.0% (11 of 11 strings) Translation: reporting-engine-15.0/reporting-engine-15.0-report_qweb_encrypt Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-15-0/reporting-engine-15-0-report_qweb_encrypt/es/
e953692
to
381add4
Compare
@luisg123v I've added the missing commit and applied the rest of your suggestions, please let me know if there's anything else missing, thanks! |
381add4
to
842b0af
Compare
842b0af
to
065973e
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.
LGTM 👍
@moylop260 could you review and merge, please?
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.
👍
/ocabot merge nobump |
What a great day to merge this nice PR. Let's do it! |
Congratulations, your PR was merged at 48ad42c. Thanks a lot for contributing to OCA. ❤️ |
No description provided.