If there is no token to be shown, don't show the stat button as this might confuse the end user closes odoo/odoo#32548 Signed-off-by: Romain Libert (rli) <rli@odoo.com>
30 lines
1.4 KiB
XML
30 lines
1.4 KiB
XML
<?xml version="1.0"?>
|
|
<odoo>
|
|
<data>
|
|
|
|
<!-- Add creditcard to res.partner -->
|
|
<record id="view_partners_form_payment_defaultcreditcard" model="ir.ui.view">
|
|
<field name="name">view.res.partner.form.payment.defaultcreditcard</field>
|
|
<field name="model">res.partner</field>
|
|
<field name="inherit_id" ref="base.view_partner_form"/>
|
|
<field name="priority" eval="15"/>
|
|
<field name="arch" type="xml">
|
|
<button name="toggle_active" position="before">
|
|
<button type="action" class="oe_stat_button"
|
|
icon="fa-credit-card"
|
|
name="%(payment.payment_token_action)d"
|
|
context="{'search_default_partner_id': active_id}"
|
|
attrs="{'invisible': [('payment_token_count', '=', 0)]}">
|
|
<div class="o_form_field o_stat_info">
|
|
<span class="o_stat_value">
|
|
<field name="payment_token_count" widget="statinfo" nolabel="1"/>
|
|
</span>
|
|
<span class="o_stat_text">Credit card(s)</span>
|
|
</div>
|
|
</button>
|
|
</button>
|
|
</field>
|
|
</record>
|
|
</data>
|
|
</odoo>
|