Files
odoo_source/addons/payment_stripe/views/payment_views.xml
T
Horacio Tellez bc9536ebe9 [IMP] payment_*: set password widget on sensible fields
When setting up an acquirer there is sensible information to
be supplied.
There was inconsistency on what was obfuscated and what not.
Now sensible information as passwords and keys is obfuscated
and public information as names and addresses is visible.

Task - 2694139

closes odoo/odoo#81211

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-02-28 12:55:47 +00:00

53 lines
3.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="payment_acquirer_form" model="ir.ui.view">
<field name="name">Stripe Acquirer Form</field>
<field name="model">payment.acquirer</field>
<field name="inherit_id" ref="payment.payment_acquirer_form"/>
<field name="arch" type="xml">
<xpath expr="//group[@name='acquirer']" position="before">
<group invisible="context.get('stripe_onboarding', False)"
name="stripe_onboarding_group"
attrs="{'invisible': ['|', '|', ('provider', '!=', 'stripe'), ('stripe_secret_key', '!=', False), ('stripe_publishable_key', '!=', False)]}">
<button string="Connect Stripe"
type="object"
name="action_stripe_connect_account"
class="btn-primary"
attrs="{'invisible': [('state', '=', 'enabled')]}"/>
</group>
</xpath>
<xpath expr="//group[@name='acquirer']" position="inside">
<group attrs="{'invisible': [('provider', '!=', 'stripe')]}" name="stripe_credentials">
<field name="stripe_publishable_key" attrs="{'required':[('provider', '=', 'stripe'), ('state', '!=', 'disabled')]}"/>
<field name="stripe_secret_key" attrs="{'required':[('provider', '=', 'stripe'), ('state', '!=', 'disabled')]}" password="True"/>
<label for="stripe_webhook_secret"/>
<div class="o_row" col="2">
<field name="stripe_webhook_secret" password="True"/>
<button string="Generate your webhook"
type="object"
name="action_stripe_create_webhook"
class="btn-primary"
attrs="{'invisible': ['|', ('stripe_webhook_secret', '!=', False), ('stripe_secret_key', '=', False)]}"/>
</div>
</group>
<div name="stripe_keys_link"
invisible="not context.get('stripe_onboarding', False)"
attrs="{'invisible': ['|', ('provider', '!=', 'stripe'), '&amp;', ('stripe_secret_key', '!=', False), ('stripe_publishable_key', '!=', False)]}">
<a class="btn btn-link" role="button" href="https://dashboard.stripe.com/account/apikeys" target="_blank">
Get your Secret and Publishable keys
</a>
</div>
</xpath>
</field>
</record>
<record id="action_payment_acquirer_onboarding" model="ir.actions.act_window">
<field name="name">Payment Acquirers</field>
<field name="res_model">payment.acquirer</field>
<field name="view_mode">form</field>
<field name="context">{'stripe_onboarding': True, 'form_view_initial_mode': 'edit'}</field>
</record>
</odoo>