<odoo>
    <record id="view_picking_form" model="ir.ui.view">
        <field name="model">stock.picking</field>
        <field name="inherit_id" ref="stock.view_picking_form" />
        <field name="arch" type="xml">
            <button name="action_toggle_is_locked" position="after">
                <button
                    name="%(action_import_serial_number)d"
                    string="Import S/N"
                    attrs="{'invisible': ['|', ('state', '!=', 'assigned'), ('picking_type_code', '!=', 'incoming')]}"
                    type="action"
                    groups="base.group_user"
                />
            </button>
        </field>
    </record>
</odoo>
