Previously, when toggling on background shapes, they always had the default colours. In [1] we made it so that when you toggle on a shape on a section, it would automatically reuse the colors of the surrounding shapes if any. Unfortunately, when the "implicit" colors were also the default colors, they were still marked on the shape, and it got an explicit background image that would no longer react to changes in the palette. This was caused by the fact that the call to _getDefaultColors returns an empty object when the section doesn't already have a shape-container, this was not a problem before since we were not passing in any colors when creating the initial shape previously, the the aforementioned change made it so that we did. This commit fixes the issue by creating the shape-container before calling the method that will set the colors on the shape, this way getDefaultColors works as expected, and the colors are not marked on the section when they are the default ones, restoring the ability of the shape colors to adapt to the palette [1]: https://github.com/odoo/odoo/commit/875aca63f7dab287c61485ebe999b3b8dd89d91c task-2500607 closes odoo/odoo#70054 X-original-commit: 63acc2b0d1957dedd40af2033722f9ea4ef2e597 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com> Co-authored-by: Tom De Caluwé <tdc@odoo.com>
16 lines
549 B
Python
16 lines
549 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
import odoo
|
|
import odoo.tests
|
|
|
|
|
|
@odoo.tests.common.tagged('post_install', '-at_install', 'website_snippets')
|
|
class TestSnippets(odoo.tests.HttpCase):
|
|
|
|
def test_01_empty_parents_autoremove(self):
|
|
self.start_tour("/?enable_editor=1", "snippet_empty_parent_autoremove", login='admin')
|
|
|
|
def test_02_default_shape_gets_palette_colors(self):
|
|
self.start_tour("/?enable_editor=1", "default_shape_gets_palette_colors", login='admin')
|