Before this commit, this bug was present in edit mode: - Go into edit mode on an empty page. - Click on the THEME tab on the right. - Click on the empty "DRAG BUILDING BLOCKS HERE" area. - Click on the THEME tab again. - The content of THEME is empty. It was because since this commit [1], clicking on an 'oeStructure' activate the Blocks tab but without updating the options in the tabs. Another similar bug was present when clicking the style tab and then clicking on the theme tab. About the first bug, actually a call of '_updateRightPanelContent' is already done in '_activateSnippet()' (and the Blocks tab is activate by default) so we only have to use '_activateSnippet(false)' to activate the Blocks tab. This commit also remove '_updateRightPanelContent' from the click event of the Blocks tab where it was not necessary. For the second bug, we can't do the same fix, because it's not possible to activate the options tab with only '_activateSnippet(false)' so we had to combine the two functions. [1]: https://github.com/odoo/odoo/commit/fbe048c202ff7878984adf26bef0651a45851f0a task-2794266 closes odoo/odoo#88537 X-original-commit: 52d32e26c34bef10823582ef5c1f840492b73d7a Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
27 lines
1.2 KiB
Python
27 lines
1.2 KiB
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
import odoo.tests
|
|
from odoo.addons.base.tests.common import HttpCaseWithUserDemo
|
|
|
|
|
|
@odoo.tests.tagged('-at_install', 'post_install')
|
|
class TestUi(HttpCaseWithUserDemo):
|
|
def setUp(self):
|
|
super().setUp()
|
|
self.user_demo.groups_id |= self.env.ref('mass_mailing.group_mass_mailing_user')
|
|
self.user_demo.groups_id |= self.env.ref('mail.group_mail_template_editor')
|
|
|
|
def test_01_mass_mailing_editor_tour(self):
|
|
self.start_tour("/web", 'mass_mailing_editor_tour', login="demo")
|
|
mail = self.env['mailing.mailing'].search([('subject', '=', 'Test')])[0]
|
|
# The tour created and saved an email. The edited version should be
|
|
# saved in body_arch, and its transpiled version (see convert_inline)
|
|
# for email client compatibility should be saved in body_html. This
|
|
# ensures both fields have different values.
|
|
self.assertEqual(mail.body_arch, '<p><br></p>')
|
|
self.assertEqual(mail.body_html, '<p style="margin:0px 0 14px 0;box-sizing:border-box;"><br></p>')
|
|
|
|
def test_02_mass_mailing_snippets_menu_tabs(self):
|
|
self.start_tour("/web", 'mass_mailing_snippets_menu_tabs', login="demo")
|