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

[15.0][MIG] base_comment_template: Migration to 15.0 #646

Merged
merged 41 commits into from
Sep 16, 2022

Conversation

victoralmau
Copy link
Member

Superseed: #619

Migration to 15.0

Please @pedrobaeza and @CarlosRoca13 can you review it?

@Tecnativa TT35696

@pedrobaeza
Copy link
Member

/ocabot migrationbase_comment_template

@OCA-git-bot
Copy link
Contributor

Hi @pedrobaeza. Your command failed:

Invalid command: migrationbase_comment_template.

Ocabot commands

  • ocabot merge major|minor|patch|nobump
  • ocabot rebase* ocabot migration {MODULE_NAME}

More information

@pedrobaeza
Copy link
Member

/ocabot migration base_comment_template

@OCA-git-bot OCA-git-bot added this to the 15.0 milestone Sep 2, 2022
@OCA-git-bot OCA-git-bot mentioned this pull request Sep 2, 2022
20 tasks
Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

Please add a commit on top of the previous one with your changes instead of blending them with the existing.

</p>
<label for="body" string="Base Comment content" />
<hr />
<!-- SMS Template Preview -->
Copy link
Member

Choose a reason for hiding this comment

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

This has no sense

string="Template Preview Engine",
default="jinja",
default="inline_template",
Copy link
Member

Choose a reason for hiding this comment

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

A migration script is needed to convert existing values to this new one.

Copy link
Contributor

@hailangvn hailangvn left a comment

Choose a reason for hiding this comment

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

Functional test ok. Thanks for the work.

@marylla
Copy link
Contributor

marylla commented Sep 13, 2022

@victoralmau Can you please update your PR as Pedro suggested. Thank you! :)

guewen and others added 21 commits September 13, 2022 16:29
Port modules base_comment_template and invoice_comment_template to V10
OCA Transbot updated translations from Transifex

OCA Transbot updated translations from Transifex

OCA Transbot updated translations from Transifex
Currently translated at 100.0% (15 of 15 strings)

Translation: account-invoice-reporting-12.0/account-invoice-reporting-12.0-base_comment_template
Translate-URL: https://translation.odoo-community.org/projects/account-invoice-reporting-12-0/account-invoice-reporting-12-0-base_comment_template/gl/

[ADD] icon.png
Currently translated at 100.0% (15 of 15 strings)

Translation: account-invoice-reporting-12.0/account-invoice-reporting-12.0-base_comment_template
Translate-URL: https://translation.odoo-community.org/projects/account-invoice-reporting-12-0/account-invoice-reporting-12-0-base_comment_template/ja/
Currently translated at 100.0% (15 of 15 strings)

Translation: account-invoice-reporting-12.0/account-invoice-reporting-12.0-base_comment_template
Translate-URL: https://translation.odoo-community.org/projects/account-invoice-reporting-12-0/account-invoice-reporting-12-0-base_comment_template/pt/
Currently translated at 100.0% (15 of 15 strings)

Translation: account-invoice-reporting-12.0/account-invoice-reporting-12.0-base_comment_template
Translate-URL: https://translation.odoo-community.org/projects/account-invoice-reporting-12-0/account-invoice-reporting-12-0-base_comment_template/pt_BR/
[IMP] Move comment_template_id from account_invoice_comment_template and make it company_dependant

[IMP] base_comment_template: Add test
…d to the Invoicing tab

[IMP] account_invoice_comment_template: rename partner field name from comment_template_id to invoice_comment_template_id

[IMP] account_invoice_comment_template: Make partner field company_dependant and move domain definition of invoice fields from the view to the model

[MOV] account_invoice_comment_template: comment_template_id to base_comment_template

[IMP] account_invoice_comment_template: Translate templates when partner changes
[UPD] README.rst

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: account-invoice-reporting-12.0/account-invoice-reporting-12.0-base_comment_template
Translate-URL: https://translation.odoo-community.org/projects/account-invoice-reporting-12-0/account-invoice-reporting-12-0-base_comment_template/
Currently translated at 100.0% (21 of 21 strings)

Translation: account-invoice-reporting-12.0/account-invoice-reporting-12.0-base_comment_template
Translate-URL: https://translation.odoo-community.org/projects/account-invoice-reporting-12-0/account-invoice-reporting-12-0-base_comment_template/pt_BR/
Currently translated at 100.0% (21 of 21 strings)

Translation: account-invoice-reporting-12.0/account-invoice-reporting-12.0-base_comment_template
Translate-URL: https://translation.odoo-community.org/projects/account-invoice-reporting-12-0/account-invoice-reporting-12-0-base_comment_template/pt/
Currently translated at 95.2% (20 of 21 strings)

Translation: account-invoice-reporting-12.0/account-invoice-reporting-12.0-base_comment_template
Translate-URL: https://translation.odoo-community.org/projects/account-invoice-reporting-12-0/account-invoice-reporting-12-0-base_comment_template/hr/
Previous field declaration was incorrect due to a typo, leading to non applying the
company dependent features.

Now everything is correct and the migration scripts care of moving data properly.
Previous field declaration was incorrect due to a typo, leading to non applying the
company dependent features.

Now everything is correct and the migration scripts care of moving data properly.
Currently translated at 100.0% (21 of 21 strings)

Translation: account-invoice-reporting-12.0/account-invoice-reporting-12.0-base_comment_template
Translate-URL: https://translation.odoo-community.org/projects/account-invoice-reporting-12-0/account-invoice-reporting-12-0-base_comment_template/de/
Currently translated at 100.0% (21 of 21 strings)

Translation: account-invoice-reporting-12.0/account-invoice-reporting-12.0-base_comment_template
Translate-URL: https://translation.odoo-community.org/projects/account-invoice-reporting-12-0/account-invoice-reporting-12-0-base_comment_template/pt_PT/
Currently translated at 100.0% (21 of 21 strings)

Translation: account-invoice-reporting-12.0/account-invoice-reporting-12.0-base_comment_template
Translate-URL: https://translation.odoo-community.org/projects/account-invoice-reporting-12-0/account-invoice-reporting-12-0-base_comment_template/sk/

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: account-invoice-reporting-12.0/account-invoice-reporting-12.0-base_comment_template
Translate-URL: https://translation.odoo-community.org/projects/account-invoice-reporting-12-0/account-invoice-reporting-12-0-base_comment_template/
As the field was not properly converted to property at 2.0.0, the script fails to do its
job when migrating from v11, so we need to adapt the scripts to this situation.
victoralmau and others added 14 commits September 13, 2022 16:44
…oid FK constraint

- The name of the columns were swapped, so better to fix it for avoiding
  mistakes due to this.
- Migration script for detecting the condition and swap column names.
- On v12 > v13 migration, include JOINs for avoiding FK constraint,
  which `ON CONFLICT` clause doesn't protect.
[UPD] Update base_comment_template.pot

[UPD] README.rst

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: reporting-engine-14.0/reporting-engine-14.0-base_comment_template
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-14-0/reporting-engine-14-0-base_comment_template/
1. Safe eval domain before checking if it is defined. This makes [] be "False" on the first check, and provides the proper use case for when the domain is empty
2. Use filtered_domain in record instead of a search in self. When on a compute, we are on a NewId context, so the search would always fail

TT29309
Currently translated at 100.0% (36 of 36 strings)

Translation: reporting-engine-14.0/reporting-engine-14.0-base_comment_template
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-14-0/reporting-engine-14-0-base_comment_template/pt/
Currently translated at 100.0% (36 of 36 strings)

Translation: reporting-engine-14.0/reporting-engine-14.0-base_comment_template
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-14-0/reporting-engine-14-0-base_comment_template/it/
[UPD] Update base_comment_template.pot

[UPD] README.rst

base_comment_template 14.0.3.0.0

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: reporting-engine-14.0/reporting-engine-14.0-base_comment_template
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-14-0/reporting-engine-14-0-base_comment_template/
base_comment_template 14.0.3.0.1
@victoralmau
Copy link
Member Author

The commits are already separated and I have added the migration script to convert the text of templates.

@marylla
Copy link
Contributor

marylla commented Sep 15, 2022

@pedrobaeza Can you review again please?

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

Missed jinja to inline_template value mapping

@victoralmau
Copy link
Member Author

Missed jinja to inline_template value mapping

Sorry, I don't understand exactly what you mean.

The engine change from jinja to inline_template is only used in wizard to rendering the comment.

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

OK, seen

@pedrobaeza
Copy link
Member

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

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

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@OCA-git-bot OCA-git-bot merged commit 9ecc402 into OCA:15.0 Sep 16, 2022
@OCA-git-bot
Copy link
Contributor

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

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.