[IMP] server_environment_data_encryption, data_encryption: black, isort, prettier

This commit is contained in:
Mourad 2020-10-12 14:07:41 +02:00 committed by Florian da Costa
parent a687e84e3b
commit f76b6a58fc
4 changed files with 89 additions and 34 deletions

View File

@ -150,7 +150,10 @@ class ServerEnvMixin(models.AbstractModel):
self, view_id=None, view_type="form", toolbar=False, submenu=False
):
res = super().fields_view_get(
view_id=view_id, view_type=view_type, toolbar=toolbar, submenu=submenu,
view_id=view_id,
view_type=view_type,
toolbar=toolbar,
submenu=submenu,
)
res["arch"] = self._update_form_view_from_env(res["arch"], view_type)
return res

View File

@ -1,15 +1,22 @@
<form string="Test">
<header>
<button string="Reset Confirmation"
type="object" name="set_draft"
states="done"/>
<button
string="Reset Confirmation"
type="object"
name="set_draft"
states="done"
/>
</header>
<sheet>
<group col="4">
<field name="test" modifiers="{&quot;required&quot;: true}"/>
<field name="test2" attrs="{'readonly': [('type_env_is_editable', '=', False)]}"
on_change="1" modifiers="{&quot;readonly&quot;: [[&quot;type_env_is_editable&quot;, &quot;=&quot;, false]]}"/>
<field name="date" modifiers="{&quot;readonly&quot;: true}"/>
<field name="test" modifiers="{&quot;required&quot;: true}" />
<field
name="test2"
attrs="{'readonly': [('type_env_is_editable', '=', False)]}"
on_change="1"
modifiers="{&quot;readonly&quot;: [[&quot;type_env_is_editable&quot;, &quot;=&quot;, false]]}"
/>
<field name="date" modifiers="{&quot;readonly&quot;: true}" />
</group>
</sheet>
</form>

View File

@ -1,6 +1,11 @@
<form string="Test">
<header>
<button string="Reset Confirmation" type="object" name="set_draft" states="done"/>
<button
string="Reset Confirmation"
type="object"
name="set_draft"
states="done"
/>
</header>
<sheet>
<div class="d-flex justify-content-between">
@ -8,14 +13,31 @@
<strong>Modify values for test environment</strong>
</div>
<div>
<button name="action_change_env_data_encrypted_fields" type="object" string="Define values for preprod" class="btn btn-lg btn-primary ml-2" context="{'environment': 'preprod'}"/>
<button name="action_change_env_data_encrypted_fields" type="object" string="Define values for prod" class="btn btn-lg btn-primary ml-2" context="{'environment': 'prod'}"/>
<button
name="action_change_env_data_encrypted_fields"
type="object"
string="Define values for preprod"
class="btn btn-lg btn-primary ml-2"
context="{'environment': 'preprod'}"
/>
<button
name="action_change_env_data_encrypted_fields"
type="object"
string="Define values for prod"
class="btn btn-lg btn-primary ml-2"
context="{'environment': 'prod'}"
/>
</div>
</div><group col="4">
<field name="test" modifiers="{&quot;required&quot;: true}"/>
<field name="test2" attrs="{'readonly': [('type_env_is_editable', '=', False)]}" on_change="1" modifiers="{&quot;readonly&quot;: [[&quot;type_env_is_editable&quot;, &quot;=&quot;, false]]}"/>
<field name="date" modifiers="{&quot;readonly&quot;: true}"/>
</div>
<group col="4">
<field name="test" modifiers="{&quot;required&quot;: true}" />
<field
name="test2"
attrs="{'readonly': [('type_env_is_editable', '=', False)]}"
on_change="1"
modifiers="{&quot;readonly&quot;: [[&quot;type_env_is_editable&quot;, &quot;=&quot;, false]]}"
/>
<field name="date" modifiers="{&quot;readonly&quot;: true}" />
</group>
</sheet>
</form>

View File

@ -1,6 +1,11 @@
<form string="Test">
<header>
<button string="Reset Confirmation" type="object" name="set_draft" states="done"/>
<button
string="Reset Confirmation"
type="object"
name="set_draft"
states="done"
/>
</header>
<sheet>
<div class="d-flex justify-content-between">
@ -8,14 +13,32 @@
<strong>Modify values for prod environment</strong>
</div>
<div>
<button name="action_change_env_data_encrypted_fields" type="object" string="Define values for preprod" class="btn btn-lg btn-primary ml-2" context="{'environment': 'preprod'}"/>
<button name="action_change_env_data_encrypted_fields" type="object" string="Define values for test" class="btn btn-lg btn-primary ml-2" context="{'environment': 'test'}"/>
<button
name="action_change_env_data_encrypted_fields"
type="object"
string="Define values for preprod"
class="btn btn-lg btn-primary ml-2"
context="{'environment': 'preprod'}"
/>
<button
name="action_change_env_data_encrypted_fields"
type="object"
string="Define values for test"
class="btn btn-lg btn-primary ml-2"
context="{'environment': 'test'}"
/>
</div>
</div><group col="4">
<field name="test" modifiers="{&quot;readonly&quot;: true}" readonly="1"/>
<field name="test2" attrs="{'readonly': [('type_env_is_editable', '=', False)]}" on_change="1" modifiers="{&quot;readonly&quot;: true}" readonly="1"/>
<field name="date" modifiers="{&quot;readonly&quot;: true}" readonly="1"/>
</div>
<group col="4">
<field name="test" modifiers="{&quot;readonly&quot;: true}" readonly="1" />
<field
name="test2"
attrs="{'readonly': [('type_env_is_editable', '=', False)]}"
on_change="1"
modifiers="{&quot;readonly&quot;: true}"
readonly="1"
/>
<field name="date" modifiers="{&quot;readonly&quot;: true}" readonly="1" />
</group>
</sheet>
</form>