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

  <!-- INHERITED VIEW FOR THE OBJECT : delivery_carrier_template_option -->
  <record id="delivery_carrier_template_option_view_form" model="ir.ui.view">
    <field name="name">delivery_base.delivery_carrier_option.view_form</field>
    <field name="model">delivery.carrier.template.option</field>
    <field name="inherit_id" ref="base_delivery_carrier_label.delivery_carrier_template_option_view_form"/>
    <field name="arch" type="xml">
      <field name="name" position="after">
        <field name="postlogistics_service_group_id"/>
      </field>
    </field>
  </record>

  <record id="delivery_carrier_template_option_view_tree" model="ir.ui.view">
    <field name="name">delivery_base.delivery_carrier_template_option.view_tree</field>
    <field name="model">delivery.carrier.template.option</field>
    <field name="inherit_id" ref="base_delivery_carrier_label.delivery_carrier_template_option_view_tree"/>
    <field name="arch" type="xml">
      <field name="name" position="after">
        <field name="postlogistics_service_group_id"/>
      </field>
    </field>
  </record>

  <!-- INHERITED VIEW FOR THE OBJECT : delivery_carrier_option -->
  <record id="delivery_carrier_option_view_form" model="ir.ui.view">
    <field name="name">delivery_base.delivery_carrier_option.view_form</field>
    <field name="model">delivery.carrier.option</field>
    <field name="inherit_id" ref="base_delivery_carrier_label.delivery_carrier_option_view_form" />
    <field name="arch" type="xml">
      <field name="tmpl_option_id" position="before">
        <field name="tmpl_option_id_domain" invisible="1" />
        <field name="carrier_id" invisible="1"/>
      </field>
      <field name="tmpl_option_id" position="attributes">
        <attribute name="domain">tmpl_option_id_domain</attribute>
      </field>
    </field>
  </record>

  <!-- INHERITED VIEW FOR THE OBJECT : delivery.carrier -->
  <record id="view_delivery_carrier_form" model="ir.ui.view">
    <field name="name">delivery_base.delivery.carrier.view_form</field>
    <field name="model">delivery.carrier</field>
    <field name="inherit_id" ref="base_delivery_carrier_label.view_delivery_carrier_form" />
    <field name="arch" type="xml">
      <field name="carrier_type" position="attributes">
        <attribute name="invisible">1</attribute>
      </field>
      <field name="delivery_type" position="after">
        <field name="postlogistics_service_group_id" attrs="{'invisible': [('delivery_type', '!=', 'postlogistics')], 'required': [('delivery_type', '=', 'postlogistics')]}"/>
        <field name="postlogistics_license_id" attrs="{'invisible': [('delivery_type', '!=', 'postlogistics')]}"/>
        <field name="allowed_options_domain" invisible="1" />
      </field>
      <field name="available_option_ids" position="attributes">
        <attribute name="context">{'default_carrier_id': active_id, 'default_tmpl_option_id_domain': allowed_options_domain}</attribute>
      </field>
    </field>
  </record>

  <record model="ir.ui.view" id="view_quant_package_form">
    <field name="name">stock.quant.package.form</field>
    <field name="model">stock.quant.package</field>
    <field name="inherit_id" ref="stock.view_quant_package_form"/>
    <field name="arch" type="xml">
      <field name="parent_id" position="after">
        <field name="postlogistics_manual_cod_amount"/>
      </field>
    </field>
  </record>

</odoo>
