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

[16.0][MIG] report_qweb_encrypt: Migration to 16.0 #779

Merged
merged 22 commits into from
Aug 10, 2023

Conversation

payen000
Copy link
Contributor

No description provided.

@payen000 payen000 force-pushed the 16.0-report_qweb_encrypt-mig-payen branch 6 times, most recently from 29f9feb to 7ef5792 Compare July 24, 2023 18:18
@payen000 payen000 marked this pull request as ready for review July 24, 2023 18:29
@payen000
Copy link
Contributor Author

Hello @luisg123v, could you review this, please?

@payen000 payen000 changed the title [MIG] report_qweb_encrypt: Migration to 16.0 [16.0][MIG] report_qweb_encrypt: Migration to 16.0 Aug 1, 2023
Copy link

@luisg123v luisg123v left a 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

"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",

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.

Copy link
Contributor Author

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!

msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: Automatically generated\n"

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.

Copy link
Contributor Author

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)

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

Copy link
Contributor Author

@payen000 payen000 Aug 3, 2023

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,

Choose a reason for hiding this comment

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

did you mean encrypted?

Copy link
Contributor Author

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.

@luisg123v
Copy link

/ocabot migration report_qweb_encrypt

@OCA-git-bot
Copy link
Contributor

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 maintainers key of its manifest.

@moylop260
Copy link

/ocabot migration report_qweb_encrypt

@OCA-git-bot OCA-git-bot added this to the 16.0 milestone Aug 2, 2023
@OCA-git-bot OCA-git-bot mentioned this pull request May 10, 2023
15 tasks
oca-ci and others added 3 commits August 3, 2023 08:44
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/
@payen000 payen000 marked this pull request as draft August 3, 2023 16:28
@payen000 payen000 force-pushed the 16.0-report_qweb_encrypt-mig-payen branch 2 times, most recently from ca8b7bd to e953692 Compare August 3, 2023 16:35
@payen000 payen000 marked this pull request as ready for review August 3, 2023 16:42
@payen000
Copy link
Contributor Author

payen000 commented Aug 3, 2023

@luisg123v I've updated this PR, could you review again, please?

@payen000 payen000 changed the title [16.0][MIG] report_qweb_encrypt: Migration to 16.0 [16.0][MIG] report_qweb_encrypt: Migration to 16.0 task#71917 Aug 3, 2023
@payen000 payen000 changed the title [16.0][MIG] report_qweb_encrypt: Migration to 16.0 task#71917 [16.0][MIG] report_qweb_encrypt: Migration to 16.0 Aug 3, 2023
Copy link

@luisg123v luisg123v left a 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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done :)

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

Copy link
Contributor Author

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done :)

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.

Copy link
Contributor Author

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/
@payen000 payen000 force-pushed the 16.0-report_qweb_encrypt-mig-payen branch from e953692 to 381add4 Compare August 10, 2023 17:05
@payen000
Copy link
Contributor Author

@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!

@payen000 payen000 force-pushed the 16.0-report_qweb_encrypt-mig-payen branch from 381add4 to 842b0af Compare August 10, 2023 17:48
@payen000 payen000 force-pushed the 16.0-report_qweb_encrypt-mig-payen branch from 842b0af to 065973e Compare August 10, 2023 17:52
Copy link

@luisg123v luisg123v left a 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?

Copy link

@moylop260 moylop260 left a comment

Choose a reason for hiding this comment

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

👍

@moylop260
Copy link

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 16.0-ocabot-merge-pr-779-by-moylop260-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 59698bf into OCA:16.0 Aug 10, 2023
6 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 48ad42c. Thanks a lot for contributing to OCA. ❤️

@moylop260 moylop260 deleted the 16.0-report_qweb_encrypt-mig-payen branch August 10, 2023 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.