<?xml version="1.0" encoding="utf-8"?>
<odoo>

    <record id="view_delivery_carrier_form_with_provider_purolator" model="ir.ui.view">
        <field name="name">delivery.carrier.form.provider.purolator</field>
        <field name="model">delivery.carrier</field>
        <field name="inherit_id" ref="delivery.view_delivery_carrier_form"/>
        <field name="arch" type="xml">
            <xpath expr="//page[@name='destination']" position='before'>
                <page string="Purolator Configuration" name="purolator_configuration" attrs="{'invisible': [('delivery_type', '!=', 'purolator')]}">
                    <group>
                        <group>
                            <field name="purolator_api_key" attrs="{'required': [('delivery_type', '=', 'purolator')]}"/>
                            <field name="purolator_password" attrs="{'required': [('delivery_type', '=', 'purolator')]}" password="True"/>
                            <field name="purolator_activation_key" attrs="{'required': [('delivery_type', '=', 'purolator')]}"/>
                            <field name="purolator_account_number" attrs="{'required': [('delivery_type', '=', 'purolator')]}"/>
                            <field name="purolator_service_type" attrs="{'required': [('delivery_type', '=', 'purolator')]}"/>
                            <field name="purolator_label_file_type" attrs="{'required': [('delivery_type', '=', 'purolator')]}"/>
                            <field name="package_by_field" />
                            <field name="purolator_default_package_type_id" attrs="{'required': [('delivery_type', '=', 'purolator')]}"/>
                        </group>
                    </group>
                </page>
            </xpath>
        </field>
    </record>

</odoo>
