From 3225f2b9fc0120cf33cc9fad244a472fc32a57f8 Mon Sep 17 00:00:00 2001 From: Achraf Mhadhbi Date: Tue, 18 Oct 2022 11:52:09 +0200 Subject: [PATCH] [MIG] base_comment_template : Migration to 16.0 --- base_comment_template/README.rst | 6 +++++- base_comment_template/__manifest__.py | 2 +- .../post-migration.py | 0 base_comment_template/readme/CONTRIBUTORS.rst | 4 ++++ .../tests/test_base_comment_template.py | 19 ++++++++++++++++--- 5 files changed, 26 insertions(+), 5 deletions(-) rename base_comment_template/migrations/{15.0.1.0.0 => 16.0.1.0.0}/post-migration.py (100%) diff --git a/base_comment_template/README.rst b/base_comment_template/README.rst index a6dd4f38d..f8ad4b9a1 100644 --- a/base_comment_template/README.rst +++ b/base_comment_template/README.rst @@ -23,7 +23,7 @@ Base Comments Templates :target: https://runbot.odoo-community.org/runbot/143/15.0 :alt: Try me on Runbot -|badge1| |badge2| |badge3| |badge4| |badge5| +|badge1| |badge2| |badge3| |badge4| |badge5| Add a new mixin class to define templates of comments to print on documents. The comment templates can be defined like make templates, so you can use variables from linked models. @@ -162,6 +162,10 @@ Contributors * Alan Ramos +* `Bloopark systems `_: + + * Achraf Mhadhbi + Maintainers ~~~~~~~~~~~ diff --git a/base_comment_template/__manifest__.py b/base_comment_template/__manifest__.py index 913a95af7..c6857151a 100644 --- a/base_comment_template/__manifest__.py +++ b/base_comment_template/__manifest__.py @@ -5,7 +5,7 @@ "name": "Base Comments Templates", "summary": "Add conditional mako template to any report" "on models that inherits comment.template.", - "version": "15.0.1.0.0", + "version": "16.0.1.0.0", "category": "Reporting", "website": "https://github.com/OCA/reporting-engine", "author": "Camptocamp, Odoo Community Association (OCA)", diff --git a/base_comment_template/migrations/15.0.1.0.0/post-migration.py b/base_comment_template/migrations/16.0.1.0.0/post-migration.py similarity index 100% rename from base_comment_template/migrations/15.0.1.0.0/post-migration.py rename to base_comment_template/migrations/16.0.1.0.0/post-migration.py diff --git a/base_comment_template/readme/CONTRIBUTORS.rst b/base_comment_template/readme/CONTRIBUTORS.rst index 27a71627d..b30c0edb1 100644 --- a/base_comment_template/readme/CONTRIBUTORS.rst +++ b/base_comment_template/readme/CONTRIBUTORS.rst @@ -24,3 +24,7 @@ * `Jarsa `_: * Alan Ramos + +* `Bloopark systems `_: + + * Achraf Mhadhbi diff --git a/base_comment_template/tests/test_base_comment_template.py b/base_comment_template/tests/test_base_comment_template.py index d8fc35620..359aee55a 100644 --- a/base_comment_template/tests/test_base_comment_template.py +++ b/base_comment_template/tests/test_base_comment_template.py @@ -1,6 +1,7 @@ # Copyright 2020 NextERP Romania SRL # Copyright 2021 Tecnativa - Víctor Martínez # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from odoo import Command from odoo.tests import common from odoo.tools.misc import mute_logger @@ -99,12 +100,24 @@ class TestCommentTemplate(common.TransactionCase): ) def test_render_comment_text_(self): + ro_RO_lang = ( + self.env["res.lang"] + .with_context(active_test=False) + .search([("code", "=", "ro_RO")]) + ) with mute_logger("odoo.addons.base.models.ir_translation"): self.env["base.language.install"].create( - {"lang": "ro_RO", "overwrite": True} + {"overwrite": True, "lang_ids": [(6, 0, [ro_RO_lang.id])]} ).lang_install() - with mute_logger("odoo.tools.translate"): - self.env["base.update.translations"].create({"lang": "ro_RO"}).act_update() + + module = self.env.ref("base.module_test_translation_import") + export = self.env["base.language.export"].create( + {"lang": "ro_RO", "format": "po", "modules": [Command.set([module.id])]} + ) + export.act_getfile() + po_file = export.data + self.assertIsNotNone(po_file) + partner_title = self.ResPartnerTitle.create( {"name": "Ambassador", "shortcut": "Amb."} )