Files
odoo_source/addons/payment/views/account_payment_views.xml
T
Xavier Morel ee15b8461d [REM] payment: dynamic domains
Make the domain stricter as well:

* no reason to have / match a token if the payment method is not
  electronic
* don't lose the capture mode
* don't remove the company filter though it's probably not useful (as
  the journal and payment should already be in the same company so the
  check on the token's acquirer's journal should be enough)

The domain used to select the default payment should not matter too much.

Task 2147923

closes odoo/odoo#40959

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-12-03 13:59:25 +00:00

22 lines
1.2 KiB
XML

<?xml version="1.0"?>
<odoo>
<data>
<record id="view_account_payment_form_inherit_payment" model="ir.ui.view">
<field name="name">view.account.payment.form.inherit.payment</field>
<field name="model">account.payment</field>
<field name="inherit_id" ref="account.view_account_payment_form"/>
<field name="arch" type="xml">
<xpath expr='//group[2]' position="inside">
<field name="payment_transaction_id" groups="base.group_no_one" attrs="{'invisible': [('payment_method_code', '!=', 'electronic')]}"/>
</xpath>
<field name="payment_method_id" position="after">
<field name="payment_method_code" invisible="1"/>
<field name="related_partner_ids" invisible="1"/>
<field name="payment_token_id" options="{'no_create': True}"
attrs="{'invisible': [('payment_method_code', '!=', 'electronic')], 'readonly': [('state', '!=', 'draft')]}"/>
</field>
</field>
</record>
</data>
</odoo>