<odoo>
  <data>
    <record model="ir.actions.server" id="action_parse_upgrade_errors">
        <field name="name">Parse upgrade errors</field>
        <field name="model_id" ref="runbot.model_runbot_build" />
         <field name="binding_model_id" ref="runbot.model_runbot_build" />
        <field name="type">ir.actions.server</field>
        <field name="state">code</field>
        <field name="code">
            action = records._parse_upgrade_errors()
        </field>
    </record>

    <record id="upgrade_exception_tree" model="ir.ui.view">
        <field name="name">runbot.upgrade.exception</field>
        <field name="model">runbot.upgrade.exception</field>
        <field name="arch" type="xml">
            <list string="Upgrade Exceptions">
                <field name="bundle_id" widget="frontend_url"/>
                <field name="elements"/>
                <field name="info"/>
                <field name="create_date"/>
                <field name="create_uid"/>
                <field name="team_id"/>
            </list>
        </field>
    </record>

    <record id="upgrade_exception_form" model="ir.ui.view">
      <field name="name">runbot.upgrade.exception</field>
      <field name="model">runbot.upgrade.exception</field>
      <field name="arch" type="xml">
          <form string="Upgrade Exceptions">
            <sheet>
              <group>
                <field name="active"/>
                <field name="bundle_id" widget="frontend_url"/>
                <field name="pr_ids">
                  <list>
                    <field name="branch_url" widget="url"/>
                    <field name="alive"/>
                  </list>
                </field>
                <field name="elements"/>
                <field name="info"/>
                <field name="create_date"/>
                <field name="create_uid"/>
                <field name="team_id"/>
                <field name="message"  readonly="0"/>
                <button name="action_post_message" groups="runbot.group_runbot_admin" string="Post message on all pull requests" type="object" invisible="not create_date"/>
                <button name="action_auto_rebuild" string="rebuild templates" type="object" invisible="not create_date"/>
              </group>
            </sheet>
            <chatter/>
          </form>
      </field>
  </record>



    <record id="upgrade_regex_tree" model="ir.ui.view">
        <field name="name">runbot.upgrade.regex</field>
        <field name="model">runbot.upgrade.regex</field>
        <field name="arch" type="xml">
            <list string="Upgrade Regex">
                <field name="prefix"/>
                <field name="regex"/>
            </list>
        </field>
    </record>

    <record id="upgrade_exception_search_view" model="ir.ui.view">
      <field name="name">runbot.upgrade.exception.filter</field>
      <field name="model">runbot.upgrade.exception</field>
      <field name="arch" type="xml">
        <search string="Search exceptions">
          <field name="elements"/>
          <field name="bundle_id"/>
          <filter string="Created by me" name="created_by_me" domain="[('create_uid', '=', uid)]"/>
        </search>
      </field>
    </record>

    <record id="open_view_upgrade_exception_tree" model="ir.actions.act_window">
        <field name="name">Upgrade Exceptions</field>
        <field name="res_model">runbot.upgrade.exception</field>
        <field name="view_mode">list,form</field>
    </record>

    <record id="open_view_upgrade_regex_tree" model="ir.actions.act_window">
        <field name="name">Upgrade Regexes</field>
        <field name="res_model">runbot.upgrade.regex</field>
        <field name="view_mode">list,form</field>
    </record>

  </data>
</odoo>
