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

<!--
CUSTOM CUBE FOR SALES
-->

    <record model="olap.fact.database" id="fact_databases_BI">
        <field name="name">OpenERP Sales Databases</field>
        <field name="db_name">sales</field>
        <field name="db_login">postgres</field>
        <field name="db_password">postgres</field>
    </record>
<!--
Schema
-->
    <record model="olap.schema" id="schema_main_sales">
        <field name="name">OpenERPSales</field>
        <field name="state">none</field>
        <field name="database_id" ref="fact_databases_BI"/>
    </record>

<!--
Adding the database tables and database columns to be used and making up the of the
cube table and cube table line
-->

    <record model="olap.database.tables" id="table_sale_order_line">
        <field name="name">sale_order_line</field>
        <field name="table_db_name">sale_order_line</field>
        <field name="fact_database_id" ref="fact_databases_BI"/>
        <field name="active">True</field>
    </record>

    <record model="olap.database.tables" id="table_sale_order">
        <field name="name">sale_order</field>
        <field name="table_db_name">sale_order</field>
        <field name="fact_database_id" ref="fact_databases_BI"/>
        <field name="active">True</field>
    </record>

    <record model="olap.database.tables" id="table_product_product">
        <field name="name">product_product</field>
        <field name="table_db_name">product_product</field>
        <field name="fact_database_id" ref="fact_databases_BI"/>
        <field name="active">True</field>
    </record>

    <record model="olap.database.tables" id="table_product_template">
        <field name="name">product_template</field>
        <field name="table_db_name">product_template</field>
        <field name="fact_database_id" ref="fact_databases_BI"/>
        <field name="active">True</field>
    </record>

    <record model="olap.database.tables" id="table_product_category">
        <field name="name">product_category</field>
        <field name="table_db_name">product_category</field>
        <field name="fact_database_id" ref="fact_databases_BI"/>
        <field name="active">True</field>
    </record>
    <record model="olap.database.tables" id="table_res_partner_address">
        <field name="name">res_partner_address</field>
        <field name="table_db_name">res_partner_address</field>
        <field name="fact_database_id" ref="fact_databases_BI"/>
        <field name="active">True</field>
    </record>

    <record model="olap.database.tables" id="table_res_country">
        <field name="name">res_country</field>
        <field name="table_db_name">res_country</field>
        <field name="fact_database_id" ref="fact_databases_BI"/>
        <field name="active">True</field>
    </record>

    <record model="olap.database.tables" id="table_res_user">
        <field name="name">res_users</field>
        <field name="table_db_name">res_users</field>
        <field name="fact_database_id" ref="fact_databases_BI"/>
        <field name="active">True</field>
    </record>

    <record model="olap.database.tables" id="table_res_partner">
        <field name="name">res_partner</field>
        <field name="table_db_name">res_partner</field>
        <field name="fact_database_id" ref="fact_databases_BI"/>
        <field name="active">True</field>

    </record>
    <record model="olap.database.columns" id="columns_product_id_sale_order_line">
        <field name="name">product_id</field>
        <field name="column_db_name">product_id</field>
        <field name="type">int4</field>
        <field name="table_id" ref="table_sale_order_line"/>
        <field name="related_to" ref="table_product_product"/>
        <field name="active">True</field>
    </record>

    <record model="olap.database.columns" id="columns_product_product_id">
        <field name="name">id</field>
        <field name="column_db_name">id</field>
        <field name="type">int4</field>
        <field name="table_id" ref="table_product_product"/>
        <field name="primary_key">True</field>
        <field name="active">True</field>
</record>

    <record model="olap.database.columns" id="columns_product_template_id">
        <field name="name">id</field>
        <field name="column_db_name">id</field>
        <field name="type">varchar</field>
        <field name="table_id" ref="table_product_template"/>
        <field name="active">True</field>
        <field name="primary_key">True</field>
    </record>

    <record model="olap.database.columns" id="columns_sale_order_line_id">
        <field name="name">id</field>
        <field name="column_db_name">id</field>
        <field name="type">int4</field>
        <field name="table_id" ref="table_sale_order_line"/>
        <field name="active">True</field>
        <field name="primary_key">True</field>
    </record>

    <record model="olap.database.columns" id="columns_sale_order_id">
        <field name="name">id</field>
        <field name="column_db_name">id</field>
        <field name="type">int4</field>
        <field name="table_id" ref="table_sale_order"/>
        <field name="active">True</field>
        <field name="primary_key">True</field>
    </record>

    <record model="olap.database.columns" id="columns_sale_order_amount_total">
        <field name="name">amount_total</field>
        <field name="column_db_name">amount_total</field>
        <field name="type">float8</field>
        <field name="table_id" ref="table_sale_order"/>
        <field name="active">True</field>
    </record>

    <record model="olap.database.columns" id="columns_res_user_name">
        <field name="name">name</field>
        <field name="column_db_name">name</field>
        <field name="type">varchar</field>
        <field name="table_id" ref="table_res_user"/>
        <field name="active">True</field>
    </record>

    <record model="olap.database.columns" id="columns_product_category_name">
        <field name="name">name</field>
        <field name="column_db_name">name</field>
        <field name="type">varchar</field>
        <field name="table_id" ref="table_product_category"/>
        <field name="active">True</field>
    </record>

    <record model="olap.database.columns" id="columns_product_template_category_id">
        <field name="name">categ_id</field>
        <field name="column_db_name">categ_id</field>
        <field name="type">int4</field>
        <field name="table_id" ref="table_product_template"/>
        <field name="related_to" ref="table_product_category"/>
        <field name="active">True</field>
    </record>

    <record model="olap.database.columns" id="columns_product_template_name">
        <field name="name">name</field>
        <field name="column_db_name">name</field>
        <field name="type">varchar</field>
        <field name="table_id" ref="table_product_template"/>
        <field name="active">True</field>
    </record>

    <record model="olap.database.columns" id="columns_res_partner_address_city">
        <field name="name">city</field>
        <field name="column_db_name">city</field>
        <field name="type">varchar</field>
        <field name="table_id" ref="table_res_partner_address"/>
        <field name="active">True</field>
    </record>
    <record model="olap.database.columns" id="columns_res_country_name">
        <field name="name">name</field>
        <field name="column_db_name">name</field>
        <field name="type">varchar</field>
        <field name="table_id" ref="table_res_country"/>
        <field name="active">True</field>
    </record>

    <record model="olap.database.columns" id="columns_product_product_product_tmpl_id">
        <field name="name">product_tmpl_id</field>
        <field name="column_db_name">product_tmpl_id</field>
        <field name="type">varchar</field>
        <field name="table_id" ref="table_product_product"/>
        <field name="related_to" ref="table_product_template"/>
        <field name="active">True</field>
    </record>

    <record model="olap.database.columns" id="columns_product_category_id">
        <field name="name">id</field>
        <field name="column_db_name">id</field>
        <field name="type">int4</field>
        <field name="table_id" ref="table_product_category"/>
        <field name="primary_key">True</field>
        <field name="active">True</field>
    </record>

    <record model="olap.database.columns" id="columns_product_template_id">
        <field name="name">id</field>
        <field name="column_db_name">id</field>
        <field name="type">int4</field>
        <field name="table_id" ref="table_product_template"/>
        <field name="primary_key">True</field>
        <field name="active">True</field>
    </record>

    <record model="olap.database.columns" id="columns_product_product_default_code">
        <field name="name">default_code</field>
        <field name="column_db_name">default_code</field>
        <field name="type">varchar</field>
        <field name="table_id" ref="table_product_product"/>
        <field name="active">True</field>
    </record>

    <record model="olap.database.columns" id="columns_sale_order_date_order">
        <field name="name">date_order</field>
        <field name="column_db_name">date_order</field>
        <field name="type">date</field>
        <field name="table_id" ref="table_sale_order"/>
        <field name="active">True</field>
    </record>

    <record model="olap.database.columns" id="columns_sale_order_line_product_uom_qty">
        <field name="name">product_uom_qty</field>
        <field name="column_db_name">product_uom_qty</field>
        <field name="type">int4</field>
        <field name="table_id" ref="table_sale_order_line"/>
        <field name="active">True</field>
    </record>

    <record model="olap.database.columns" id="columns_sale_order_line_price_unit">
        <field name="name">price_unit</field>
        <field name="column_db_name">price_unit</field>
        <field name="type">int4</field>
        <field name="table_id" ref="table_sale_order_line"/>
        <field name="active">True</field>
    </record>

    <record model="olap.database.columns" id="columns_sale_order_line_id">
        <field name="name">id</field>
        <field name="column_db_name">id</field>
        <field name="type">int4</field>
        <field name="table_id" ref="table_sale_order_line"/>
        <field name="primary_key">True</field>
        <field name="active">True</field>
    </record>

    <record model="olap.database.columns" id="columns_sale_order_line_order_id">
        <field name="name">order_id</field>
        <field name="column_db_name">order_id</field>
        <field name="type">int4</field>
        <field name="table_id" ref="table_sale_order_line"/>
        <field name="related_to" ref="table_sale_order"/>
        <field name="active">True</field>
    </record>

    <record model="olap.database.columns" id="columns_sale_order_partner_id">
        <field name="name">partner_id</field>
        <field name="column_db_name">partner_id</field>
        <field name="type">int4</field>
        <field name="table_id" ref="table_sale_order"/>
        <field name="related_to" ref="table_res_partner"/>
        <field name="active">True</field>
    </record>

    <record model="olap.database.columns" id="columns_res_partner_address_id">
        <field name="name">id</field>
        <field name="column_db_name">id</field>
        <field name="type">int4</field>
        <field name="table_id" ref="table_res_partner_address"/>
        <field name="primary_key">True</field>
        <field name="active">True</field>
    </record>

    <record model="olap.database.columns" id="columns_res_partner_id">
        <field name="name">id</field>
        <field name="column_db_name">id</field>
        <field name="type">int4</field>
        <field name="table_id" ref="table_res_partner"/>
        <field name="primary_key">True</field>
        <field name="active">True</field>
    </record>

    <record model="olap.database.columns" id="columns_res_partner_name">
        <field name="name">name</field>
        <field name="column_db_name">name</field>
        <field name="type">varchar</field>
        <field name="table_id" ref="table_res_partner"/>
        <field name="active">True</field>
    </record>

    <record model="olap.database.columns" id="columns_res_user_id">
        <field name="name">id</field>
        <field name="column_db_name">id</field>
        <field name="type">int4</field>
        <field name="table_id" ref="table_res_user"/>
        <field name="primary_key">True</field>
        <field name="active">True</field>
    </record>

    <record model="olap.database.columns" id="columns_res_country_id">
        <field name="name">id</field>
        <field name="column_db_name">id</field>
        <field name="type">int4</field>
        <field name="table_id" ref="table_res_country"/>
        <field name="primary_key">True</field>
        <field name="active">True</field>
    </record>

    <record model="olap.database.columns" id="columns_sale_order_partner_order_id">
        <field name="name">partner_order_id</field>
        <field name="column_db_name">partner_order_id</field>
        <field name="type">int4</field>
        <field name="table_id" ref="table_sale_order"/>
        <field name="related_to" ref="table_res_partner_address"/>
        <field name="active">True</field>
    </record>

    <record model="olap.database.columns" id="columns_res_user_name">
        <field name="name">name</field>
        <field name="column_db_name">name</field>
        <field name="type">varchar</field>
        <field name="table_id" ref="table_res_user"/>
        <field name="active">True</field>
    </record>

    <record model="olap.database.columns" id="columns_res_country_name">
        <field name="name">name</field>
        <field name="column_db_name">name</field>
        <field name="type">varchar</field>
        <field name="table_id" ref="table_res_country"/>
        <field name="active">True</field>
    </record>

    <record model="olap.database.columns" id="columns_res_partner_address_country_id">
        <field name="name">country_id</field>
        <field name="column_db_name">country_id</field>
        <field name="type">int4</field>
        <field name="table_id" ref="table_res_partner_address"/>
        <field name="related_to" ref="table_res_country"/>
        <field name="active">True</field>
    </record>

    <record model="olap.database.columns" id="columns_res_partner_address_city">
        <field name="name">city</field>
        <field name="column_db_name">city</field>
        <field name="type">varchar</field>
        <field name="table_id" ref="table_res_partner_address"/>
        <field name="active">True</field>
    </record>

    <record model="olap.database.columns" id="columns_sale_order_line_order_id">
        <field name="name">order_id</field>
        <field name="column_db_name">order_id</field>
        <field name="type">int4</field>
        <field name="table_id" ref="table_sale_order_line"/>
        <field name="related_to" ref="table_sale_order"/>
        <field name="active">True</field>
    </record>

    <record model="olap.database.columns" id="columns_sale_order_line_product_uom_qty">
        <field name="name">product_uom_qty</field>
        <field name="column_db_name">product_uom_qty</field>
        <field name="type">numeric</field>
        <field name="table_id" ref="table_sale_order_line"/>
        <field name="active">True</field>
    </record>

    <record model="olap.database.columns" id="columns_sale_order_line_price_unit">
        <field name="name">price_unit</field>
        <field name="column_db_name">price_unit</field>
        <field name="type">numeric</field>
        <field name="table_id" ref="table_sale_order_line"/>
        <field name="active">True</field>
    </record>

    <record model="olap.database.columns" id="columns_sale_order_line_create_uid">
        <field name="name">create_uid</field>
        <field name="column_db_name">create_uid</field>
        <field name="type">int4</field>
        <field name="table_id" ref="table_sale_order_line"/>
        <field name="related_to" ref="table_res_user"/>
        <field name="active">True</field>
    </record>


<!--
Making of the olap.cube.table and olap.cube.table.lines

-->
    <record model="olap.cube.table" id="cube_table_sale_order_line">
        <field name="name">Sales</field>
        <field name='schema_id' ref='schema_main_sales'/>
        <field name='column_link_id' ref='columns_sale_order_line_id'/>
    </record>

    <record model="olap.cube.table" id="cube_table_product_category">
        <field name="name">Product Category</field>
        <field name='schema_id' ref='schema_main_sales'/>
        <field name='column_link_id' ref="columns_product_id_sale_order_line"/>
    </record>

    <record model="olap.cube.table.line" id="line_prodcut_category_line_21">
        <field name="field_id" ref="columns_product_product_product_tmpl_id"/>
        <field name="table_id" ref="table_product_product"/>
        <field name="cube_table_id" ref="cube_table_product_category"/>
    </record>

    <record model="olap.cube.table.line" id="line_prodcut_category_line_31">
        <field name="field_id" ref="columns_product_template_category_id"/>
        <field name="table_id" ref="table_product_template"/>
        <field name="cube_table_id" ref="cube_table_product_category"/>
    </record>

    <record model="olap.cube.table.line" id="line_sale_order_line">
        <field name="field_id" ref="columns_sale_order_line_order_id"/>
        <field name="table_id" ref="table_sale_order_line"/>
        <field name="cube_table_id" ref="cube_table_sale_order_line"/>
    </record>

    <record model="olap.cube.table" id="product_table">
        <field name="name">Sale Product</field>
        <field name='schema_id' ref='schema_main_sales'/>
        <field name='column_link_id' ref='columns_product_id_sale_order_line'/>
    </record>

    <record model="olap.cube.table" id="country_table">
        <field name="name">Sale Country</field>
        <field name='schema_id' ref='schema_main_sales'/>
        <field name='column_link_id' ref='columns_sale_order_line_order_id'/>
    </record>

    <record model="olap.cube.table" id="address_table">
        <field name='schema_id' ref='schema_main_sales'/>
        <field name="name">sale_order_line</field>
        <field name='column_link_id' ref='columns_sale_order_line_order_id'/>
    </record>

    <record model="olap.cube.table" id="date_table">
        <field name="name">sale_order_line</field>
        <field name='schema_id' ref='schema_main_sales'/>
        <field name='column_link_id' ref='columns_sale_order_line_order_id'/>
    </record>

    <record model="olap.cube.table" id="user_table">
        <field name="name">sale_order_line</field>
        <field name='schema_id' ref='schema_main_sales'/>
        <field name='column_link_id' ref='columns_sale_order_line_create_uid'/>
    </record>

    <record model="olap.cube.table.line" id="country_table_line_id_2">
        <field name="field_id" ref="columns_sale_order_partner_order_id"/>
        <field name="table_id" ref="table_sale_order"/>
        <field name="cube_table_id" ref="country_table"/>
    </record>

    <record model="olap.cube.table.line" id="country_table_line_id_3">
        <field name="field_id" ref="columns_res_partner_address_country_id"/>
        <field name="table_id" ref="table_res_partner_address"/>
        <field name="cube_table_id" ref="country_table"/>
    </record>

    <record model="olap.cube.table.line" id="country_table_line_id_31">
        <field name="field_id" ref="columns_sale_order_partner_order_id"/>
        <field name="table_id" ref="table_sale_order"/>
        <field name="cube_table_id" ref="address_table"/>
    </record>

    <record model="olap.cube.table.line" id="country_table_line_id_41">
        <field name="field_id" ref="columns_sale_order_partner_id"/>
        <field name="table_id" ref="table_res_partner_address"/>
        <field name="cube_table_id" ref="address_table"/>
    </record>

<!--
Fact Table
sale_order_line
-->

    <record model="olap.cube" id="cube_sales_order_line">
        <field name="name">Sales</field>
        <field name="table_id" ref="cube_table_sale_order_line"/>
        <field name="schema_id" ref="schema_main_sales"/>
    </record>

<!--
DIMENSION PRODUCT CATEGORY

product_template (product_id)
-->

    <record model="olap.dimension" id="dimension_product_template">
        <field name="name"> All Products</field>
        <field name="cube_id" ref="cube_sales_order_line"/>
    </record>

    <record model="olap.hierarchy" id="hierarchy_product_template">
        <field name="name">All Products</field>
        <field name="dimension_id" ref="dimension_product_template"/>
        <field name="primary_key_table">product_product</field>
        <field name="table_id" ref="product_table"/>
    </record>

    <record model="olap.level" id="level_product_template">
        <field name="name">Product Code</field>
        <field name="column_name" ref="columns_product_product_default_code"></field>
        <field name="column_id_name">default_code</field>
        <field name="table_name">product_product</field>
        <field name="hierarchy_id" ref="hierarchy_product_template"/>
    </record>
<!--
Adding of the product by the category
-->
    <record model="olap.dimension" id="dimension_product_category">
        <field name="name">Products by Category</field>
        <field name="cube_id" ref="cube_sales_order_line"/>
    </record>

    <record model="olap.hierarchy" id="hierarchy_product_category">
        <field name="name">Products Category</field>
        <field name="dimension_id" ref="dimension_product_category"/>
        <field name="primary_key_table">product_product</field>
        <field name="table_id" ref="cube_table_product_category"/>
    </record>

    <record model="olap.level" id="level_product_category_1">
        <field name="name">Product Category</field>
        <field name="column_name" ref="columns_product_category_name"></field>
        <field name="column_id_name">name</field>
        <field name="table_name">product_category</field>
        <field name="hierarchy_id" ref="hierarchy_product_category"/>
    </record>

    <record model="olap.level" id="level_product_category_2">
        <field name="name">Product</field>
        <field name="column_name" ref="columns_product_template_name"></field>
        <field name="column_id_name">name</field>
        <field name="table_name">product_template</field>
        <field name="hierarchy_id" ref="hierarchy_product_category"/>
    </record>
<!--
DIMENSION ORDER DATE
sale_order (order_id)
-->
    <record model="olap.dimension" id="dimension_sales_order">
        <field name="name">Order Date</field>
        <field name="cube_id" ref="cube_sales_order_line"/>
    </record>

    <record model="olap.hierarchy" id="hierarchy_sales_order">
        <field name="name">Order Date</field>
        <field name="dimension_id" ref="dimension_sales_order"/>
        <field name="primary_key_table">sale_order</field>
        <field name="table_id" ref="date_table"/>
    </record>

    <record model="olap.level" id="level_sales_order">
        <field name="name">date_order</field>
        <field name="column_name" ref="columns_sale_order_date_order"></field>
        <field name="column_id_name">date_order</field>
        <field name="type">date_year</field>
        <field name="sequence">1</field>
        <field name="table_name">sale_order</field>
        <field name="hierarchy_id" ref="hierarchy_sales_order"/>
    </record>

    <record model="olap.level" id="level_sales_order_q">
        <field name="name">date_order</field>
        <field name="column_name" ref="columns_sale_order_date_order"></field>
        <field name="column_id_name">date_order</field>
        <field name="type">date_quarter</field>
        <field name="sequence">2</field>
        <field name="table_name">sale_order</field>
        <field name="hierarchy_id" ref="hierarchy_sales_order"/>
    </record>

    <record model="olap.level" id="level_sales_order_m">
        <field name="name">date_order</field>
        <field name="column_name" ref="columns_sale_order_date_order"></field>
        <field name="column_id_name">date_order</field>
        <field name="type">date_month</field>
        <field name="sequence">3</field>
        <field name="table_name">sale_order</field>
        <field name="hierarchy_id" ref="hierarchy_sales_order"/>
    </record>
<!--
DIMENSION ORDER DATE

partner_country (order_id)
-->
<!--
DIMENSION PARTNER TO COUNTRY
res_users (user_id)
-->

    <record model="olap.dimension" id="dimension_partner_country">
        <field name="name">Country</field>
        <field name="cube_id" ref="cube_sales_order_line"/>
    </record>

    <record model="olap.hierarchy" id="hierarchy_partner_country">
        <field name="name">Partner Country</field>
        <field name="dimension_id" ref="dimension_partner_country"/>
        <field name="primary_key_table">sale_order</field>
        <field name="table_id" ref="country_table"/>
    </record>

    <record model="olap.level" id="level_partner_country">
        <field name="name">country_id</field>
        <field name="column_name" ref="columns_res_country_name"></field>
        <field name="column_id_name">name</field>
        <field name="table_name">res_country</field>
        <field name="hierarchy_id" ref="hierarchy_partner_country"/>
    </record>

<!--
DIMENSION PARTNER_ADDRESS TO COUNTRY
-->

    <record model="olap.dimension" id="dimension_partner_address_country">
        <field name="name">Sales by Partner City</field>
        <field name="cube_id" ref="cube_sales_order_line"/>
    </record>

    <record model="olap.hierarchy" id="hierarchy_partner_address_country">
        <field name="name">City</field>
        <field name="dimension_id" ref="dimension_partner_address_country"/>
        <field name="primary_key_table">sale_order</field>
        <field name="table_id" ref="address_table"/>
    </record>

    <record model="olap.level" id="level_address_country">
        <field name="name">city</field>
        <field name="sequence">1</field>
        <field name="column_name" ref="columns_res_partner_address_city"></field>
        <field name="column_id_name">city</field>
        <field name="table_name">res_partner_address</field>
        <field name="hierarchy_id" ref="hierarchy_partner_address_country"/>
    </record>

    <record model="olap.level" id="level_address_country_1">
        <field name="name">name</field>
        <field name="sequence">2</field>
        <field name="column_name" ref="columns_res_partner_name"></field>
        <field name="column_id_name">name</field>
        <field name="table_name">res_partner</field>
        <field name="hierarchy_id" ref="hierarchy_partner_address_country"/>
    </record>



<!--
DIMENSION SALEMAN

res_users (user_id)
-->

    <record model="olap.dimension" id="dimension_sales_user">
        <field name="name">Users</field>
        <field name="cube_id" ref="cube_sales_order_line"/>
    </record>

    <record model="olap.hierarchy" id="hierarchy_sales_user">
        <field name="name">Users</field>
        <field name="dimension_id" ref="dimension_sales_user"/>
        <field name="primary_key_table">res_users</field>
        <field name="table_id" ref="user_table"/>
    </record>

    <record model="olap.level" id="hierarchy_sales_user_level">
        <field name="name">name</field>
        <field name="column_name" ref="columns_res_user_name"></field>
        <field name="hierarchy_id" ref="hierarchy_sales_user"/>
        <field name="table_name">res_users</field>
        <field name="column_id_name">name</field>
    </record>




<!--
Measures
-->

    <record model="olap.measure" id="measure_item_sold">
        <field name="name">Average Sales</field>
        <field name="cube_id" ref="cube_sales_order_line"/>
        <field name="value_column" ref="columns_sale_order_amount_total"></field>
        <field name="value_column_id_name">amount_total</field>
        <field name="table_name">sale_order</field>
        <field name="agregator">avg</field>
        <field name="formatstring">cr_postfix</field>
    </record>
    <record model="olap.measure" id="measure_total_sales">
        <field name="name">Total Sales</field>
        <field name="cube_id" ref="cube_sales_order_line"/>
        <field name="value_column" ref="columns_sale_order_amount_total"></field>
        <field name="value_column_id_name">amount_total</field>
        <field name="table_name">sale_order</field>
        <field name="agregator">sum</field>
        <field name="formatstring">cr_postfix_comma</field>
    </record>

    <record model="olap.measure" id="measure_sql_expression">
        <field name="name">Units Sold</field>
        <field name="cube_id" ref="cube_sales_order_line"/>
        <field name="measure_type">sql_expr</field>
        <field name="value_sql">count(sale_order.id)</field>
    </record>


</data>
</openerp>
