<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <!-- Actions -->
        <record id="action_view" model="ir.ui.view">
            <field name="name">ir.actions.actions</field>
            <field name="model">ir.actions.actions</field>
            <field name="arch" type="xml">
                <form string="Action" version="7.0">
                    <group>
                        <field name="name"/>
                        <field name="type"/>
                        <field name="usage"/>
                    </group>
                </form>
            </field>
        </record>
        <record id="action_view_tree" model="ir.ui.view">
            <field name="name">ir.actions.actions.tree</field>
            <field name="model">ir.actions.actions</field>
            <field name="arch" type="xml">
                <tree string="Action">
                    <field name="name"/>
                    <field name="type"/>
                </tree>
            </field>
        </record>
        <record id="action_view_search" model="ir.ui.view">
            <field name="name">ir.actions.actions.search</field>
            <field name="model">ir.actions.actions</field>
            <field name="arch" type="xml">
                <search string="Action">
                    <field name="name" filter_domain="['|', ('name','ilike',self), ('type','ilike',self)]" string="Action"/>
                </search>
            </field>
        </record>

        <record id="ir_sequence_actions" model="ir.actions.act_window">
            <field name="name">Actions</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">ir.actions.actions</field>
            <field name="view_type">form</field>
            <field name="view_id" ref="action_view_tree"/>
            <field name="search_view_id" ref="action_view_search"/>
        </record>
        <menuitem id="next_id_6" name="Actions" parent="base.menu_custom" sequence="2"/>
        <menuitem action="ir_sequence_actions" id="menu_ir_sequence_actions" parent="next_id_6"/>



        <record id="act_report_xml_view" model="ir.ui.view">
            <field name="name">ir.actions.report.xml</field>
            <field name="model">ir.actions.report.xml</field>
            <field name="arch" type="xml">
                <form string="Report" version="7.0">
                    <group>
                        <group>
                            <field name="name"/>
                            <field name="report_name"/>
                            <field name="model"/>
                        </group>
                        <group>
                            <field name="usage"/>
                            <field name="report_type"/>
                            <field name="report_file"/>
                        </group>
                    </group>
                    <notebook>
                        <page string="Other Configuration">
                            <group>
                                <group string="RML Report">
                                    <field name="header"/>
                                </group>
                                <group string="XML Report">
                                    <field name="report_xsl"/>
                                    <field name="report_xml"/>
                                </group>
                                <group string="Attachments">
                                    <field name="attachment"/>
                                    <field name="attachment_use"/>
                                </group>
                                <group string="Miscellaneous">
                                    <field name="multi"/>
                                    <field name="auto"/>
                                </group>
                            </group>
                        </page>
                        <page string="Security">
                            <field name="groups_id"/>
                        </page>
                    </notebook>
                </form>
            </field>
        </record>
        <record id="act_report_xml_view_tree" model="ir.ui.view">
            <field name="name">ir.actions.report.xml.tree</field>
            <field name="model">ir.actions.report.xml</field>
            <field name="arch" type="xml">
                <tree string="Report xml">
                    <field name="name"/>
                    <field name="model"/>
                    <field name="type"/>
                    <field name="report_name"/>
                    <field name="report_type"/>
                    <field name="attachment"/>
                </tree>
            </field>
        </record>
        <record id="act_report_xml_search_view" model="ir.ui.view">
            <field name="name">ir.actions.report.xml.search</field>
            <field name="model">ir.actions.report.xml</field>
            <field name="arch" type="xml">
                <search string="Report Xml">
                    <field name="name"
                        filter_domain="['|', '|', '|', '|', ('name','ilike',self), ('model','ilike',self), ('type','ilike',self), ('report_name','ilike',self), ('report_type','ilike',self)]"
                        string="Report"/>
                    <group expand="0" string="Group By" colspan="4">
                        <filter string="Report Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'report_type'}"/>
                    </group>
                </search>
            </field>
        </record>

        <record id="ir_action_report_xml" model="ir.actions.act_window">
            <field name="name">Reports</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">ir.actions.report.xml</field>
            <field name="view_type">form</field>
            <field name="view_id" ref="act_report_xml_view_tree"/>
            <field name="search_view_id" ref="act_report_xml_search_view"/>
        </record>
        <menuitem action="ir_action_report_xml" id="menu_ir_action_report_xml" parent="base.next_id_6"/>

        <record id="view_window_action_tree" model="ir.ui.view">
            <field name="name">ir.actions.windows.tree</field>
            <field name="model">ir.actions.act_window</field>
            <field name="arch" type="xml">
                <tree string="Open Window">
                    <field name="name"/>
                    <field name="res_model"/>
                    <field name="view_type"/>
                    <field name="view_id"/>
                    <field name="domain"/>
                </tree>
            </field>
        </record>

        <record id="view_window_action_form" model="ir.ui.view">
            <field name="name">ir.actions.windows.form</field>
            <field name="model">ir.actions.act_window</field>
            <field name="arch" type="xml">
                <form string="Open a Window" version="7.0">
                    <group>
                        <group>
                            <field name="name"/>
                            <field name="res_model" string="Object"/>
                            <field name="src_model" string="Source Object"/>
                        </group>
                        <group>
                            <field name="usage"/>
                            <field name="type" readonly="1"/>
                            <field name="target"/>
                        </group>
                    </group>
                    <notebook>
                        <page string="General Settings">
                            <group>
                                <group string="Views">
                                    <field name="view_type"/>
                                    <field name="view_mode"/>
                                    <field name="view_id"/>
                                    <field name="search_view_id"/>
                                </group>
                                <group string="Filters">
                                    <field name="domain"/>
                                    <field name="context"/>
                                    <field name="limit"/>
                                    <field name="auto_refresh"/>
                                    <field name="auto_search"/>
                                    <field name="filter"/>
                                </group>
                            </group>
                            <group string="Help">
                                <field colspan="2" name="help" nolabel="1"/>
                            </group>
                            <group string="Views">
                                <field colspan="2" name="view_ids" nolabel="1">
                                    <form string="Views" version="7.0">
                                        <group>
                                            <field colspan="4" name="sequence"/>
                                            <field name="view_mode"/>
                                            <field domain="[('type', '=', view_mode)]" name="view_id"/>
                                        </group>
                                    </form>
                                    <tree string="Views">
                                        <field name="sequence"/>
                                        <field name="view_mode"/>
                                        <field name="view_id"/>
                                    </tree>
                                </field>
                            </group>
                        </page>
                        <page string="Security">
                            <field name="groups_id"/>
                        </page>
                    </notebook>
                </form>
            </field>
        </record>
        <record id="view_window_action_search" model="ir.ui.view">
            <field name="name">ir.actions.windows.search</field>
            <field name="model">ir.actions.act_window</field>
            <field name="arch" type="xml">
                <search string="Open a Window">
                    <field name="name" filter_domain="['|', ('name','ilike',self), ('res_model','ilike',self)]" string="Action"/>
                    <field name="view_type"/>
                    <group expand="0" string="Group By" colspan="4">
                        <filter string="View Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'view_type'}"/>
                    </group>
                </search>
            </field>
        </record>

        <record id="ir_action_window" model="ir.actions.act_window">
            <field name="name">Window Actions</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">ir.actions.act_window</field>
            <field name="view_type">form</field>
            <field name="search_view_id" ref="view_window_action_search"/>
        </record>
        <record id="ir_action_window_view1" model="ir.actions.act_window.view">
            <field eval="1" name="sequence"/>
            <field name="view_mode">tree</field>
            <field name="view_id" ref="view_window_action_tree"/>
            <field name="act_window_id" ref="ir_action_window"/>
        </record>
        <record id="ir_action_window_view2" model="ir.actions.act_window.view">
            <field eval="2" name="sequence"/>
            <field name="view_mode">form</field>
            <field name="view_id" ref="view_window_action_form"/>
            <field name="act_window_id" ref="ir_action_window"/>
        </record>
        <menuitem action="ir_action_window" id="menu_ir_action_window" parent="base.next_id_6"/>

        <record id="act_wizard_view_tree" model="ir.ui.view">
            <field name="name">ir.actions.wizard.tree</field>
            <field name="model">ir.actions.wizard</field>
            <field name="arch" type="xml">
                <tree string="Wizard">
                    <field name="name"/>
                    <field name="wiz_name"/>
                    <field name="multi"/>
                </tree>
            </field>
        </record>

         <record id="act_wizard_view" model="ir.ui.view">
            <field name="name">ir.actions.wizard</field>
            <field name="model">ir.actions.wizard</field>
            <field name="arch" type="xml">
                <form string="Wizards" version="7.0">
                    <group col="4">
                        <field name="name"/>
                        <field name="type"/>
                        <field name="wiz_name"/>
                        <field name="multi"/>
                    </group>
                    <label for="groups_id"/>
                    <field name="groups_id"/>
                </form>
            </field>
        </record>

        <record id="act_wizard_search_view" model="ir.ui.view">
            <field name="name">ir.actions.wizard.search</field>
            <field name="model">ir.actions.wizard</field>
            <field name="arch" type="xml">
                <search string="Wizards">
                    <field name="name"
                        filter_domain="['|', '|', ('name','ilike',self), ('type','ilike',self), ('wiz_name','ilike',self)]"
                        string="Wizard"/>
                </search>
            </field>
        </record>

        <record id="ir_action_wizard" model="ir.actions.act_window">
            <field name="name">Wizards</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">ir.actions.wizard</field>
            <field name="view_type">form</field>
            <field name="search_view_id" ref="act_wizard_search_view"/>
        </record>

        <menuitem action="ir_action_wizard" id="menu_ir_action_wizard" parent="base.next_id_6"/>


        <record id="property_rule" model="ir.rule">
            <field name="name">Property multi-company</field>
            <field model="ir.model" name="model_id" ref="model_ir_property"/>
            <field eval="True" name="global"/>
            <field name="domain_force">['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>
        </record>

        <!--server action view-->

        <record id="view_server_action_form" model="ir.ui.view">
            <field name="name">Server Action</field>
            <field name="model">ir.actions.server</field>
            <field name="arch" type="xml">
                <form string="Server Action" version="7.0">
                    <group>
                        <group>
                            <field name="name"/>
                            <field name="model_id"/>
                            <field name="state"/>
                        </group>
                        <group>
                            <field name="condition"/>
                            <field name="sequence"/>
                        </group>
                    </group>
                    <notebook colspan="4">
                        <page string="Python Code" attrs="{'invisible':[('state','!=','code')]}">
                            <field name="code"/>
                        </page>
                        <page string="Trigger" attrs="{'invisible':[('state','!=','trigger')]}">
                            <group string="Trigger Configuration" col="4">
                                <field name="wkf_model_id" attrs="{'required':[('state','=','trigger')]}"/>
                                <field name="trigger_obj_id" context="{'key':''}"
                                       domain="[('model_id','=',model_id),('ttype','in',['many2one','int'])]"
                                       attrs="{'required':[('state','=','trigger')]}"/>
                                <field name="trigger_name" attrs="{'required':[('state','=','trigger')]}"/>
                            </group>
                        </page>
                        <page string="Action to Launch" attrs="{'invisible':[('state','!=','client_action')]}">
                            <group>
                                <field name="action_id" attrs="{'required':[('state','=','client_action')]}"/>
                            </group>
                        </page>
                        <page string="Email Configuration" attrs="{'invisible':[('state','!=','email')]}">
                            <group>
                                <field name="email" domain="[('model_id','=',model_id)]" attrs="{'required':[('state','=','email')]}"/>
                                <field name="subject" attrs="{'required':[('state','=','email')]}"/>
                                <field name="message" attrs="{'required':[('state','=','email')]}"/>
                                <newline/>
                                <label colspan="2" string="Access all the fields related to the current object using expressions, i.e. object.partner_id.name " align="0.0"/>
                            </group>
                        </page>
                        <page string="SMS Configuration" attrs="{'invisible':[('state','!=','sms')]}">
                            <group>
                                <field name="mobile" domain="[('model_id','=',model_id)]" attrs="{'required':[('state','=','sms')]}"/>
                                <field name="sms" attrs="{'required':[('state','=','sms')]}"/>
                            </group>
                            <label string="Access all the fields related to the current object using expressions, i.e. object.partner_id.name " align="0.0"/>
                        </page>
                        <page string="Create / Write / Copy" attrs="{'invisible':[('state','!=','object_create'), ('state','!=','object_write'), ('state','!=','object_copy')]}">
                            <group col="4" string="Fields Mapping">
                                <field name="srcmodel_id" attrs="{'required':[('state','!=','dummy'), ('state','!=','sms'), ('state','!=','code'), ('state','!=','loop'), ('state','!=','trigger'), ('state','!=','object_copy'), ('state','!=','client_action'), ('state','!=','email'), ('state','!=','sms'), ('state','!=','other')]}"/>
                                <field name="copy_object" on_change="change_object(copy_object, state)" attrs="{'required':[('state','!=','dummy'), ('state','!=','sms'), ('state','!=','code'), ('state','!=','loop'), ('state','!=','trigger'), ('state','!=','object_write'), ('state','!=','object_create'), ('state','!=','client_action'), ('state','!=','email'), ('state','!=','sms'), ('state','!=','other')]}"/>
                                <field name="fields_lines" nolabel="1" colspan="2">
                                    <tree string="Field Mappings" editable="top">
                                        <field name="col1" domain="[('model_id','=',parent.srcmodel_id or parent.model_id)]"/>
                                        <field name="type"/>
                                        <field name="value" colspan="4"/>
                                    </tree>
                                    <form string="Field Mapping" version="7.0">
                                        <group col="4">
                                            <field name="col1" domain="[('model_id','=',parent.srcmodel_id or parent.model_id)]"/>
                                            <field name="type"/>
                                            <field name="value" colspan="4"/>
                                        </group>
                                    </form>
                                </field>
                                <field name="record_id" attrs="{'readonly':[('state','!=','object_create')]}" domain="[('model_id','in',[model_id])]"/>
                                <field name="write_id" attrs="{'readonly':[('state','!=','object_write')]}"/>
                            </group>
                            <label string="If you use a formula type, use a python expression using the variable 'object'." align="0.0"/>
                        </page>
                        <page string="Iteration Actions" attrs="{'invisible':[('state','!=','loop')]}">
                            <group col="4">
                                <field name="expression" attrs="{'required':[('state','=','loop')]}"/>
                                <field name="loop_action" domain="[('state','!=','loop')]" attrs="{'required':[('state','=','loop')]}"/>
                            </group>
                        </page>
                        <page string="Multi Actions" attrs="{'invisible':[('state','!=','other')]}">
                            <field name="child_ids"/>
                            <label string="Only one client action will be executed, last client action will be considered in case of multiple client actions." align="0.0"/>
                        </page>
                    </notebook>
                    <field name="type" readonly="1"/>
                </form>
            </field>
        </record>

        <record id="view_server_action_tree" model="ir.ui.view">
            <field name="name">Server Actions</field>
            <field name="model">ir.actions.server</field>
            <field name="arch" type="xml">
                <tree string="Server Actions">
                    <field name="name"/>
                    <field name="state"/>
                    <field name="model_id"/>
                    <field name="sequence"/>
                </tree>
            </field>
        </record>

        <record id="view_server_action_search" model="ir.ui.view">
            <field name="name">ir.actions.server.search</field>
            <field name="model">ir.actions.server</field>
            <field name="arch" type="xml">
                <search string="Server Actions">
                    <field name="name" string="Server Action"/>
                    <field name="model_id"/>
                    <field name="state"/>
                    <group expand="0" string="Group By" colspan="4" col="4">
                        <filter string="Action Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'state'}"/>
                    </group>
                </search>
            </field>
        </record>

        <record id="action_server_action" model="ir.actions.act_window">
            <field name="name">Server Actions</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">ir.actions.server</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="view_id" ref="view_server_action_tree"/>
            <field name="search_view_id" ref="view_server_action_search"/>
            <field name="context">{'key':'server_action'}</field>
        </record>
        <menuitem action="action_server_action" id="menu_server_action" parent="base.next_id_6"/>

        <!-- ir.actions.todo -->

        <record id="ir_actions_todo_tree" model="ir.ui.view">
            <field name="model">ir.actions.todo</field>
            <field name="name">Config Wizard Steps</field>
            <field name="arch" type="xml">
                <tree string="Config Wizard Steps">
                    <field name="sequence"/>
                    <field name="action_id"/>
                    <field name="type"/>
                    <field name="state" readonly="1"/>
                    <button name="action_launch" states="open" string="Launch" type="object" icon="gtk-execute" help="Launch Configuration Wizard"/>
                    <button name="action_open" states="done"
                            string="Todo" type="object" help="Set as Todo"
                            icon="gtk-convert"/>
                </tree>
            </field>
        </record>

        <record id="config_wizard_step_view_form" model="ir.ui.view">
            <field name="model">ir.actions.todo</field>
            <field name="name">Config Wizard Steps</field>
            <field name="arch" type="xml">
                <form string="Config Wizard Steps" version="7.0">
                  <header>
                        <button name="action_launch"
                            states="open" string="Launch"
                            type="object" icon="gtk-execute" class="oe_highlight" 
                            help="Launch Configuration Wizard"/>
                        <button name="action_open" states="done"
                            string="Set as Todo" type="object"
                            icon="gtk-convert" class="oe_highlight"/>
                        <field name="state" widget="statusbar" statusbar_visible="open,done" nolabel="1" readonly="1" statusbar_colors='{"open":"red","done":"blue"}'/>
                  </header>
                  <sheet>
                    <group col="4">
                        <field name="action_id"/>
                        <field name="type"/>
                        <field name="sequence"/>
                    </group>
                    <group string="Groups">
                        <field name="groups_id" nolabel="1" colspan="4"/>
                    </group>
                  </sheet>
                </form>
            </field>
        </record>

        <record id="config_wizard_step_view_search" model="ir.ui.view">
            <field name="model">ir.actions.todo</field>
            <field name="name">ir.actions.todo.select</field>
            <field name="arch" type="xml">
                <search string="Search Actions">
                    <filter string="To Do" name="todo" icon="terp-camera_test" domain=" [('state','=','open')]" help="Wizards to be Launched"/>
                    <field name="action_id"/>
                    <field name="state"/>
                </search>
            </field>
        </record>

        <record id="act_ir_actions_todo_form" model="ir.actions.act_window">
            <field name="name">Configuration Wizards</field>
            <field name="res_model">ir.actions.todo</field>
            <field name="view_id" ref="ir_actions_todo_tree"/>
            <field name="view_type">form</field>
            <field name="help">The configuration wizards are used to help you configure a new instance of OpenERP. They are launched during the installation of new modules, but you can choose to restart some wizards manually from this menu.</field>
        </record>
        <menuitem id="menu_ir_actions_todo" name="Configuration Wizards" parent="menu_custom" sequence="20" groups="base.group_no_one"/>
        <menuitem id="menu_ir_actions_todo_form" action="act_ir_actions_todo_form" parent="menu_ir_actions_todo"/>

        <record id="action_run_ir_action_todo" model="ir.actions.server">
            <field name="name">Run Remaining Action Todo</field>
            <field name="condition">True</field>
            <field name="type">ir.actions.server</field>
            <field name="model_id" ref="model_res_config"/>
            <field name="state">code</field>
            <field name="code">
config = self.next(cr, uid, [], context=context) or {}
if config.get('type') not in ('ir.actions.act_window_close',):
    action = config
</field>
        </record>


    </data>
</openerp>
