When debugging a database, it's sometimes desirable to neutralize it to avoid undesired side effects like sending emails. This commit adds a generic method `_neutralize` on models to neutralize the current database. This method has to be overridden by modules models that needs to be neutralized. A new CLI command `neutralize`is now available that will permit to neutralize a database from the command line before starting investigations. Pay attention that the neutralize operation cannot be reversed and should only be used on a database copy. Task id: 1818795 Part-of: odoo/odoo#67825
40 lines
1.4 KiB
XML
40 lines
1.4 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<odoo>
|
|
<template t-name="neutralize_banner" inherit_id="web.layout">
|
|
<xpath expr="//body" position="inside">
|
|
<div>
|
|
<span style="text-align: center;
|
|
color: #FFFFFF;
|
|
background-color: #D0442C;
|
|
position: relative;
|
|
display: block;
|
|
font-size: 16px;">
|
|
This database is neutralized.
|
|
</span>
|
|
</div>
|
|
</xpath>
|
|
</template>
|
|
<template t-name="neutralize_ribbon" inherit_id="web.layout">
|
|
<xpath expr="//body" position="inside">
|
|
<div>
|
|
<span style="width: 400px;
|
|
top: 55px;
|
|
left: -100px;
|
|
font-size: 32px;
|
|
text-align: center;
|
|
padding: 10px;
|
|
line-height: 30px;
|
|
color: #f0f0f0;
|
|
transform: rotate(-45deg);
|
|
position: fixed;
|
|
box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
|
|
background: #D0442C;
|
|
opacity: 0.6;
|
|
pointer-events: none;
|
|
text-transform: uppercase;
|
|
z-index:9999">Neutralized</span>
|
|
</div>
|
|
</xpath>
|
|
</template>
|
|
</odoo>
|