<?xml version="1.0"?>
<tryton>
    <data>

<!-- Analysis Sheet Template -->

        <record model="ir.ui.view" id="template_analysis_sheet_view_form">
            <field name="model">lims.template.analysis_sheet</field>
            <field name="type">form</field>
            <field name="name">template_analysis_sheet_form</field>
        </record>
        <record model="ir.ui.view" id="template_analysis_sheet_view_list">
            <field name="model">lims.template.analysis_sheet</field>
            <field name="type">tree</field>
            <field name="name">template_analysis_sheet_list</field>
        </record>
        <record model="ir.ui.view" id="template_analysis_sheet_pending_view_list">
            <field name="model">lims.template.analysis_sheet</field>
            <field name="type">tree</field>
            <field name="name">template_analysis_sheet_pending_list</field>
        </record>

        <record model="ir.action.act_window" id="act_template_analysis_sheet_list">
            <field name="name">Analysis Sheet Templates</field>
            <field name="res_model">lims.template.analysis_sheet</field>
        </record>
        <record model="ir.action.act_window.view"
            id="act_template_analysis_sheet_list_view_list">
            <field name="sequence" eval="10"/>
            <field name="view" ref="template_analysis_sheet_view_list"/>
            <field name="act_window" ref="act_template_analysis_sheet_list"/>
        </record>
        <record model="ir.action.act_window.view"
            id="act_template_analysis_sheet_list_view_form">
            <field name="sequence" eval="20"/>
            <field name="view" ref="template_analysis_sheet_view_form"/>
            <field name="act_window" ref="act_template_analysis_sheet_list"/>
        </record>

        <menuitem action="act_template_analysis_sheet_list"
            id="menu_template_analysis_sheet_list"
            parent="lims.lims_config_laboratory" sequence="70"/>

<!-- Template Analysis -->

        <record model="ir.ui.view" id="template_analysis_view_form">
            <field name="model">lims.template.analysis_sheet.analysis</field>
            <field name="type">form</field>
            <field name="name">template_analysis_form</field>
        </record>
        <record model="ir.ui.view" id="template_analysis_view_list">
            <field name="model">lims.template.analysis_sheet.analysis</field>
            <field name="type">tree</field>
            <field name="name">template_analysis_list</field>
        </record>

        <record model="ir.ui.view" id="template_analysis_detail_view_list">
            <field name="model">lims.template.analysis_sheet.analysis</field>
            <field name="type">tree</field>
            <field name="name">template_analysis_detail_list</field>
        </record>

        <record model="ir.action.act_window" id="act_template_analysis_list">
            <field name="name">Template Analysis</field>
            <field name="res_model">lims.template.analysis_sheet.analysis</field>
        </record>
        <record model="ir.action.act_window.view"
            id="act_template_analysis_list_view_list">
            <field name="sequence" eval="10"/>
            <field name="view" ref="template_analysis_detail_view_list"/>
            <field name="act_window" ref="act_template_analysis_list"/>
        </record>

        <menuitem action="act_template_analysis_list"
            id="menu_template_analysis_list"
            parent="menu_template_analysis_sheet_list" sequence="10"/>

<!-- Special Formula -->

        <record model="ir.ui.view" id="template_analysis_expression_view_form">
            <field name="model">lims.template.analysis_sheet.analysis.expression</field>
            <field name="type">form</field>
            <field name="name">template_analysis_expression_form</field>
        </record>
        <record model="ir.ui.view" id="template_analysis_expression_view_list">
            <field name="model">lims.template.analysis_sheet.analysis.expression</field>
            <field name="type">tree</field>
            <field name="name">template_analysis_expression_list</field>
        </record>

<!-- Analysis Sheet -->

        <record model="ir.ui.view" id="analysis_sheet_view_form">
            <field name="model">lims.analysis_sheet</field>
            <field name="type">form</field>
            <field name="name">analysis_sheet_form</field>
        </record>
        <record model="ir.ui.view" id="analysis_sheet_view_list">
            <field name="model">lims.analysis_sheet</field>
            <field name="type">tree</field>
            <field name="name">analysis_sheet_list</field>
        </record>

        <record model="ir.action.act_window" id="act_analysis_sheet_list">
            <field name="name">Analysis Sheets</field>
            <field name="res_model">lims.analysis_sheet</field>
        </record>
        <record model="ir.action.act_window.view"
            id="act_analysis_sheet_list_view_list">
            <field name="sequence" eval="10"/>
            <field name="view" ref="analysis_sheet_view_list"/>
            <field name="act_window" ref="act_analysis_sheet_list"/>
        </record>
        <record model="ir.action.act_window.view"
            id="act_analysis_sheet_list_view_form">
            <field name="sequence" eval="20"/>
            <field name="view" ref="analysis_sheet_view_form"/>
            <field name="act_window" ref="act_analysis_sheet_list"/>
        </record>
        <record model="ir.action.act_window.domain"
                id="act_analysis_sheet_list_domain_draft">
            <field name="name">Draft</field>
            <field name="sequence" eval="10"/>
            <field name="domain"
                eval="[('state', '=', 'draft')]" pyson="1"/>
            <field name="count" eval="True"/>
            <field name="act_window" ref="act_analysis_sheet_list"/>
        </record>
        <record model="ir.action.act_window.domain"
                id="act_analysis_sheet_list_domain_active">
            <field name="name">Active</field>
            <field name="sequence" eval="20"/>
            <field name="domain"
                eval="[('state', '=', 'active')]" pyson="1"/>
            <field name="count" eval="True"/>
            <field name="act_window" ref="act_analysis_sheet_list"/>
        </record>
        <record model="ir.action.act_window.domain"
                id="act_analysis_sheet_list_domain_validated">
            <field name="name">Validated</field>
            <field name="sequence" eval="30"/>
            <field name="domain"
                eval="[('state', '=', 'validated')]" pyson="1"/>
            <field name="count" eval="True"/>
            <field name="act_window" ref="act_analysis_sheet_list"/>
        </record>
        <record model="ir.action.act_window.domain"
                id="act_analysis_sheet_list_domain_done">
            <field name="name">Done</field>
            <field name="sequence" eval="40"/>
            <field name="domain"
                eval="[('state', '=', 'done')]" pyson="1"/>
            <field name="act_window" ref="act_analysis_sheet_list"/>
        </record>
        <record model="ir.action.act_window.domain"
                id="act_analysis_sheet_list_domain_all">
            <field name="name">All</field>
            <field name="sequence" eval="9999"/>
            <field name="act_window" ref="act_analysis_sheet_list"/>
        </record>

        <menuitem action="act_analysis_sheet_list" id="menu_analysis_sheet_list"
            parent="lims.lims_laboratory_results" sequence="35"/>

        <record model="ir.model.button" id="button_sheet_view_data">
            <field name="name">view_data</field>
            <field name="model" search="[('model', '=', 'lims.analysis_sheet')]"/>
        </record>
        <record model="ir.model.button" id="button_sheet_view_grouped_data">
            <field name="name">view_grouped_data</field>
            <field name="model" search="[('model', '=', 'lims.analysis_sheet')]"/>
        </record>
        <record model="ir.model.button" id="button_sheet_activate">
            <field name="name">activate</field>
            <field name="model" search="[('model', '=', 'lims.analysis_sheet')]"/>
        </record>
        <record model="ir.model.button" id="button_sheet_validate_">
            <field name="name">validate_</field>
            <field name="model" search="[('model', '=', 'lims.analysis_sheet')]"/>
        </record>
        <record model="ir.model.button" id="button_sheet_confirm">
            <field name="name">confirm</field>
            <field name="model" search="[('model', '=', 'lims.analysis_sheet')]"/>
        </record>

        <record model="ir.rule.group" id="rule_group_sheet">
            <field name="name">User in laboratory</field>
            <field name="model" search="[('model', '=', 'lims.analysis_sheet')]"/>
            <field name="global_p" eval="True"/>
        </record>
        <record model="ir.rule" id="rule_sheet">
            <field name="domain"
                eval="[If(Bool(Eval('user', {}).get('laboratory', False)), ('laboratory', '=', Eval('user', {}).get('laboratory', None)), If(Bool(Eval('user', {}).get('laboratories', False)), ('laboratory', 'in', Eval('user', {}).get('laboratories', [])), ('id', '!=', 0)))]"
                pyson="1"/>
            <field name="rule_group" ref="rule_group_sheet"/>
        </record>

<!-- Wizard Open Analysis Sheet Data -->

        <record model="ir.action.wizard" id="wiz_analysis_sheet_open_data">
            <field name="name">Open Analysis Sheet Data</field>
            <field name="wiz_name">lims.analysis_sheet.open_data</field>
        </record>

<!-- Wizard Export Analysis Sheet File -->

        <record model="ir.ui.view" id="analysis_sheet_export_start_view_form">
            <field name="model">lims.analysis_sheet.export_file.start</field>
            <field name="type">form</field>
            <field name="name">analysis_sheet_export_form</field>
        </record>

        <record model="ir.action.wizard" id="wiz_analysis_sheet_export_file">
            <field name="name">Export Analysis Sheet File</field>
            <field name="wiz_name">lims.analysis_sheet.export_file</field>
        </record>

        <record model="ir.action.keyword"
            id="wiz_analysis_sheet_export_file_keyword">
            <field name="keyword">form_action</field>
            <field name="model">lims.analysis_sheet,-1</field>
            <field name="action" ref="wiz_analysis_sheet_export_file"/>
        </record>
        <record model="ir.action.keyword"
            id="wiz_analysis_sheet_data_export_file_keyword">
            <field name="keyword">form_action</field>
            <field name="model">lims.interface.data,-1</field>
            <field name="action" ref="wiz_analysis_sheet_export_file"/>
        </record>

<!-- Analysis Sheet Report -->

        <record model="ir.action.report" id="report_analysis_sheet">
            <field name="name">Analysis Sheet Report</field>
            <field name="model">lims.analysis_sheet</field>
            <field name="report_name">lims.analysis_sheet.report</field>
            <field name="report">lims_analysis_sheet/report/analysis_sheet.fods</field>
        </record>

        <record model="ir.ui.view" id="analysis_sheet_print_report_ask_view_form">
            <field name="model">lims.analysis_sheet.print_report.ask</field>
            <field name="type">form</field>
            <field name="name">analysis_sheet_print_report_ask_form</field>
        </record>

        <record model="ir.action.wizard" id="wiz_analysis_sheet_print_report">
            <field name="name">Analysis Sheet Report</field>
            <field name="wiz_name">lims.analysis_sheet.print_report</field>
        </record>

        <record model="ir.action.keyword"
            id="wiz_analysis_sheet_print_report_keyword">
            <field name="keyword">form_print</field>
            <field name="model">lims.analysis_sheet,-1</field>
            <field name="action" ref="wiz_analysis_sheet_print_report"/>
        </record>
        <record model="ir.action.keyword"
            id="wiz_analysis_sheet_data_print_report_keyword">
            <field name="keyword">form_print</field>
            <field name="model">lims.interface.data,-1</field>
            <field name="action" ref="wiz_analysis_sheet_print_report"/>
        </record>

<!-- Wizard Import Analysis Sheet File -->

        <record model="ir.ui.view" id="analysis_sheet_import_start_view_form">
            <field name="model">lims.analysis_sheet.import_file.start</field>
            <field name="type">form</field>
            <field name="name">analysis_sheet_import_form</field>
        </record>

        <record model="ir.action.wizard" id="wiz_analysis_sheet_import_file">
            <field name="name">Import Analysis Sheet File</field>
            <field name="wiz_name">lims.analysis_sheet.import_file</field>
        </record>

        <record model="ir.action.keyword"
            id="wiz_analysis_sheet_import_file_keyword">
            <field name="keyword">form_action</field>
            <field name="model">lims.analysis_sheet,-1</field>
            <field name="action" ref="wiz_analysis_sheet_import_file"/>
        </record>
        <record model="ir.action.keyword"
            id="wiz_analysis_sheet_data_import_file_keyword">
            <field name="keyword">form_action</field>
            <field name="model">lims.interface.data,-1</field>
            <field name="action" ref="wiz_analysis_sheet_import_file"/>
        </record>

<!-- Wizard Open Analysis Sheet Samples -->

        <record model="ir.action.wizard" id="wiz_analysis_sheet_open_sample">
            <field name="name">Analysis Sheet Samples</field>
            <field name="wiz_name">lims.analysis_sheet.open_sample</field>
        </record>

        <record model="ir.action.keyword"
            id="wiz_analysis_sheet_open_sample_keyword">
            <field name="keyword">form_relate</field>
            <field name="model">lims.analysis_sheet,-1</field>
            <field name="action" ref="wiz_analysis_sheet_open_sample"/>
        </record>
        <record model="ir.action.keyword"
            id="wiz_analysis_sheet_data_open_sample_keyword">
            <field name="keyword">form_relate</field>
            <field name="model">lims.interface.data,-1</field>
            <field name="action" ref="wiz_analysis_sheet_open_sample"/>
        </record>

    </data>
</tryton>
