<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2013 Akretion (http://www.akretion.com)
  @author: Alexis de Lattre <alexis.delattre@akretion.com>
  The licence is in the file __openerp__.py
-->
<openerp>
<data>

<record id="view_payment_line_form" model="ir.ui.view">
    <field name="name">pain.base.payment.line.form</field>
    <field name="model">payment.line</field>
    <field name="inherit_id" ref="account_payment.view_payment_line_form"/>
    <field name="arch" type="xml">
        <field name="bank_id" position="after">
            <field name="priority"/>
            <newline />
        </field>
        <field name="state" position="after">
            <field name="struct_communication_type" attrs="{'invisible': [('state', '!=', 'structured')], 'required': [('state', '=', 'structured')]}"/>
        </field>
    </field>
</record>

<record id="view_payment_order_form" model="ir.ui.view">
    <field name="name">pain.base.payment.line.inside.order.form</field>
    <field name="model">payment.order</field>
    <field name="inherit_id" ref="account_payment.view_payment_order_form"/>
    <field name="arch" type="xml">
        <xpath expr="//field[@name='line_ids']/form//field[@name='bank_id']" position="after">
            <field name="priority"/>
            <newline />
        </xpath>
        <xpath expr="//field[@name='line_ids']/form//field[@name='state']" position="after">
            <field name="struct_communication_type" attrs="{'invisible': [('state', '!=', 'structured')], 'required': [('state', '=', 'structured')]}"/>
        </xpath>
    </field>
</record>

</data>
</openerp>
