diff --git a/odoo/addons/base/models/ir_ui_view.py b/odoo/addons/base/models/ir_ui_view.py index cb3440a111e..3dc8833b932 100644 --- a/odoo/addons/base/models/ir_ui_view.py +++ b/odoo/addons/base/models/ir_ui_view.py @@ -2333,6 +2333,8 @@ class ResetViewArchWizard(models.TransientModel): view.arch_diff = get_diff( (view_arch, get_table_name(view.view_id) if view.reset_mode == 'other_view' else _("Current Arch")), (diff_to, diff_to_name), + custom_style=False, + dark_color_scheme=request and request.httprequest.cookies.get('color_scheme') == 'dark', ) view.has_diff = view_arch != diff_to diff --git a/odoo/tools/misc.py b/odoo/tools/misc.py index 0af82222db2..5c068c11fb0 100644 --- a/odoo/tools/misc.py +++ b/odoo/tools/misc.py @@ -1669,16 +1669,17 @@ class DotDict(dict): return DotDict(val) if type(val) is dict else val -def get_diff(data_from, data_to, custom_style=False): +def get_diff(data_from, data_to, custom_style=False, dark_color_scheme=False): """ Return, in an HTML table, the diff between two texts. :param tuple data_from: tuple(text, name), name will be used as table header :param tuple data_to: tuple(text, name), name will be used as table header :param tuple custom_style: string, style css including - ''' + ''' % colors return html_diff diff = HtmlDiff(tabsize=2).make_table( @@ -1711,7 +1724,7 @@ def get_diff(data_from, data_to, custom_style=False): context=True, # Show only diff lines, not all the code numlines=3, ) - return handle_style(diff, custom_style) + return handle_style(diff, custom_style, dark_color_scheme) def hmac(env, scope, message, hash_function=hashlib.sha256):