<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2021 Camptocamp SA
     License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
    <record id="product_packaging_delivery_form" model="ir.ui.view">
        <field name="name">product.packaging.form.inherit</field>
        <field name="model">product.packaging</field>
        <field name="inherit_id" ref="delivery.product_packaging_delivery_form" />
        <field name="arch" type="xml">
            <field name="shipper_package_code" position="attributes">
                <attribute
                    name="attrs"
                >{"required": [("package_carrier_type", "=", "postlogistics")]}</attribute>
            </field>
            <field name="shipper_package_code" position="after">
                <span
                    colspan="2"
                    attrs="{'invisible': [('package_carrier_type', '!=', 'postlogistics')]}"
                >See section 8.10 of <a
                        target="new"
                        href="https://developer.post.ch/en/digital-commerce-api"
                    >the documentation</a> for available codes.</span>
            </field>
        </field>
    </record>
</odoo>
