[IMP]:olap : Add yaml file for olap module

bzr revid: ksa@tinyerp.co.in-20100421135649-qvlmte6kjus4zyqt
This commit is contained in:
ksa (Open ERP) 2010-04-21 19:26:49 +05:30
parent 40555c9105
commit 047845a7dc
4 changed files with 115 additions and 8 deletions

View File

@ -46,7 +46,8 @@
"data/olap_security.xml",
'security/ir.model.access.csv'
],
"demo_xml" : ["data/olap_demo.xml"],
"demo_xml" : ["data/olap_demo.xml",
"test/olap_test00.yml"],
"active": False,
"installable": True
}

View File

@ -274,7 +274,7 @@
<field name="table_name" select="1" />
<field name="application_id" select="1" />
<field name="is_hidden" select="1" colspan="2" />
</form>
</field>
</record>
@ -322,7 +322,7 @@
<field name="application_id" select="1" />
<newline/>
<field name="is_hidden" select="1" colspan="2"/>
</form>
</field>
</record>
@ -337,9 +337,5 @@
id="menu_view_olap_application_field_form"
parent="menu_bi_conf_known_application"/>
</data>
</openerp>

View File

@ -0,0 +1,111 @@
-
In order to check olap module which is used to configure BI from OpenERP client.I create olap fact database record.
-
!record {model: olap.fact.database, id: olap_fact_database_openerp0}:
connection_type: port
db_host: localhost
db_login: postgres
db_name: tiny
db_password: '123456'
db_port: 5432
name: OpenERP
type: postgres
-
I will check the connection for successful login. >>>>>>(Problem)
# !python {model: olap.fact.database}: |
# self.test_connection(cr, uid,[ref('olap_fact_database_openerp0')], context)
-
In order to test schema,I create a new schema record.
-
!record {model: olap.schema, id: olap_schema_Partners0}:
database_id: olap_fact_database_openerp0
name: Partners
-
I press "Connect to Database" and I see that the Schema State is "Database Connected" now
-
!workflow {model: olap.schema, action: dbconnect, ref: olap_schema_Partners0}
-
Now I will load the structure of the database. by structure we mean tables, columns and the relations. This will help in defining cube easily.
-
!record {model: bi.load.db.wizard, id: bi_load_db_wizard_0}:
db_name: OpenERP
fact_table: Partners
-
I can see two buttons for Configuration one for manually and the other is for Automatically.I press "Configure Automatically".After configuration I can see that the Boolean Configuring Data-structure is True now Schema State is "The Structure is Configured" and there is one button "Mark as Configured"
-
!record {model: bi.auto.configure.wizard, id: bi_auto_configure_wizard_Partners0}:
name: Partners
-
Performing a workflow action load on module olap.schema
-
!workflow {model: olap.schema, action: dbload, ref: olap_schema_Partners0}
-
Performing a workflow action configure on module olap.schema
-
!workflow {model: olap.schema, action: dbconfigure, ref: olap_schema_Partners0}
-
Performing a workflow action dbready on module olap.schema
-
!workflow {model: olap.schema, action: dbready, ref: olap_schema_Partners0}
-
In order to create Cube I first define the fact table.Fact table are the key tables in which measures are stored and we can branch to other tables for other parameters.
-
!record {model: olap.database.tables, id: database_table_res_partner}:
active: True
fact_database_id: fact_database_terp
name: res_partner
table_db_name: res_partner
-
I create cube table and select ID of as Relational Column.Then I select related record in Joined tables.
-
!record {model: olap.cube.table, id: olap_cube_table_partnercubetable0}:
column_link_id: olap.columns_res_partner_id
name: Partner cube table
available_table_ids:
- olap.columns_res_partner_date
- olap.columns_res_partner_id
- olap.columns_res_partner_credit_limit
- olap.columns_res_partner_user_id
-
I can configure Cube from BI Cube Designer.I make sure that OpenERP BI web-client is running.From Configuration I click on "Cube Designer" and It will open Cube Designer in my system browser.I can see that the schema "Partners" is visible through Cube Designer.
-
Creating olap cube
-
!record {model: olap.cube, id: olap_cube_partnercube0}:
name: Partner cube
query_log: true
schema_id: olap_schema_Partners0
table_id: olap_cube_table_partnercubetable0
-
After cube we can decide upon the dimensions to be used for the cube.In order to analyze Partner I create one dimension.
-
!record {model: olap.dimension, id: olap_dimension_products0}:
name: Products
cube_id: olap_cube_partnercube0
-
After adding the dimension I create hierarchy.
-
!record {model: olap.hierarchy, id: olap_hierarchy_allproducts0}:
dimension_id: olap_dimension_products0
name: All Products
sequence: 1
table_id: olap_cube_table_partnercubetable0
-
After adding the hierarchy I create level.I select Product's default_code as Columns Name that is loaded in Fact columns.
-
!record {model: olap.level, id: olap_level_productscode0}:
column_id_name: name
column_name: olap.columns_res_user_name
hierarchy_id: olap_hierarchy_allproducts0
name: Products code
sequence: 1
table_name: res_users
type: normal
-
I will check that columns is loaded in Fact Table.
-
!python {model: olap.load.column}: |
ids = self.search(cr, uid, [])
self.get_table_data(cr, uid, ids, {'active_ids': [ref('olap_cube_table_partnercubetable0')]})

View File

@ -26,7 +26,6 @@ class olap_load_column(osv.osv_memory):
_description = "Olap Load Column"
def get_table_data(self, cr, uid, ids, context={}):
"""
This function load column
@param cr: the current row, from the database cursor,