| 1 |
<?xml version="1.0" encoding="utf-8"?> |
| 2 |
<odoo> |
| 3 |
<record id="pos_payment_method_view_form_inherit_pos_online_payment" model="ir.ui.view"> |
| 4 |
<field name="name">pos.payment.method.form.inherit.pos_online_payment</field> |
| 5 |
<field name="model">pos.payment.method</field> |
| 6 |
<field name="inherit_id" ref="point_of_sale.pos_payment_method_view_form"/> |
| 7 |
<field name="arch" type="xml"> |
| 8 |
<xpath expr="//form/sheet" position="before"> |
| 9 |
<field name="has_an_online_payment_provider" invisible="1"/> |
| 10 |
<div class="alert alert-danger" role="alert" invisible="not is_online_payment or has_an_online_payment_provider"> |
| 11 |
You have not activated any <bold><a type="action" name="%(payment.action_payment_provider)d" class="alert-link" role="button">payment provider</a></bold> to allow online payments. |
| 12 |
</div> |
| 13 |
</xpath> |
| 14 |
<xpath expr="//form/sheet/group/group/field[@name='split_transactions']" position="before"> |
| 15 |
<field name="is_online_payment"/> |
| 16 |
</xpath> |
| 17 |
<xpath expr="//form/sheet/group/group/field[@name='split_transactions']" position="attributes"> |
| 18 |
<attribute name="invisible">is_online_payment</attribute> |
| 19 |
</xpath> |
| 20 |
<xpath expr="//form/sheet/group/div/group/field[@name='payment_method_type']" position="attributes"> |
| 21 |
<attribute name="invisible">is_online_payment</attribute> |
| 22 |
</xpath> |
| 23 |
<xpath expr="//form/sheet/group/div/group/field[@name='qr_code_method']" position="attributes"> |
| 24 |
<attribute name="invisible">is_online_payment or hide_qr_code_method</attribute> |
| 25 |
</xpath> |
| 26 |
<xpath expr="//form/sheet/group/group/field[@name='journal_id']" position="attributes"> |
| 27 |
<attribute name="invisible">is_online_payment</attribute> |
| 28 |
<attribute name="required">not is_online_payment and not split_transactions</attribute> |
| 29 |
</xpath> |
| 30 |
<xpath expr="//form/sheet/group/group/field[@name='receivable_account_id']" position="attributes"> |
| 31 |
<attribute name="invisible">is_online_payment or split_transactions</attribute> |
| 32 |
</xpath> |
| 33 |
<xpath expr="//form/sheet/group[@name='Payment methods']/group" position="after"> |
| 34 |
<group invisible="not is_online_payment"> |
| 35 |
<div colspan="2"> |
| 36 |
<label for="online_payment_provider_ids"/> |
| 37 |
<field name="online_payment_provider_ids" widget="many2many_tags" options="{'no_create': True}" placeholder="All available providers" /> |
| 38 |
<button name="%(payment.action_payment_provider)d" icon="fa-arrow-right" type="action" string="Payment Providers" class="btn-link" /> |
| 39 |
</div> |
| 40 |
</group> |
| 41 |
</xpath> |
| 42 |
</field> |
| 43 |
</record> |
| 44 |
|
| 45 |
<record id="pos_payment_method_view_tree_inherit_pos_online_payment" model="ir.ui.view"> |
| 46 |
<field name="name">pos.payment.method.list.inherit.pos_online_payment</field> |
| 47 |
<field name="model">pos.payment.method</field> |
| 48 |
<field name="inherit_id" ref="point_of_sale.pos_payment_method_view_tree"/> |
| 49 |
<field name="arch" type="xml"> |
| 50 |
<xpath expr="//list" position="attributes"> |
| 51 |
<attribute name="decoration-danger">is_online_payment and not has_an_online_payment_provider</attribute> |
| 52 |
</xpath> |
| 53 |
<xpath expr="//list" position="inside"> |
| 54 |
<field name="is_online_payment" optional="hide"/> |
| 55 |
<field name="has_an_online_payment_provider" column_invisible="True"/> |
| 56 |
</xpath> |
| 57 |
</field> |
| 58 |
</record> |
| 59 |
</odoo> |