<?xml version="1.0" encoding="utf-8"?>
<odoo>
  <!-- RENTAL ORDER LINES : PICKUP / RETURN WIZARD -->

  <record id="rental_order_wizard_view_form" model="ir.ui.view">
    <field name="name">rental.order.wizard.form</field>
    <field name="model">rental.order.wizard</field>
    <field name="arch" type="xml">
      <form>
        <sheet>
          <field name="status" invisible="1"/>
          <field name="has_late_lines" invisible="1"/>
          <field name="order_id" invisible="1"/>
          <field name="rental_wizard_line_ids">
            <tree create="false" editable="top">
              <field name="product_id" readonly="1" force_save="1" options="{'no_open': True}"/>
              <field name="order_line_id" invisible="1"/>
              <field name="rental_order_wizard_id" invisible="1"/>
              <field name="qty_reserved" readonly="1" attrs="{'column_invisible':[('parent.status', '=', 'return')]}"/>
              <field name="qty_delivered" attrs="{'readonly':[('parent.status', '=', 'return')]}" force_save="1"/>
              <field name="qty_returned" attrs="{'column_invisible':[('parent.status', '=', 'pickup')]}"/> <!-- Should we show the qty returned at pickup if part of the rental has been returned? -->
              <field name="is_late" invisible="1"/>
              <field name="status" invisible="1"/>
              <button icon="fa-clock-o" attrs="{
                'column_invisible': ['|', ('parent.has_late_lines', '=', False), ('parent.status', '=', 'pickup')],
                'invisible': [('is_late', '=', False)]}"
                class="text-danger" title="Some delay cost will be added to the sales order."/>
            </tree>
          </field>
          <footer>
            <button name="apply" string="Validate" type="object" class="btn-primary"/>
            <button string="Cancel" class="btn-secondary" special="cancel"/>
          </footer>
        </sheet>
      </form>
    </field>
  </record>
</odoo>
