Wizards in Reporting

OK, I know I am still calling them wizards.  The name has grown on me.  I mean osv_memory objects.  At least it isn’t as confusing as OpenERP calling a python class an object, and a python object an instance but I digress.  For the record when I say object I use it for both a python class and python object.  Usually which one I am referring to is clear by the context, if it isn’t then I’ll use class and record or instance respectively.

So why do we want to use wizards in reporting.

Well sometimes we don’t.  Sales Orders (maybe), Invoices etc, we press print and away we go.  Pops up a screen and we select our report, and generally it is the same one.  But sometimes, we want the report to look different depending on some attributes of our object (I’m just going to use sale.order here to make it real) such as its state.  Excellent, just create a wizard and tell it to choose between 2 reports based on state.  Well no, again, we can place conditional content in our reports based on any attribute of the sale.order (or for that matter any relation we can chain to such as partner or sale order line)  so we don’t need 2 reports.  (Hmm I better do a section on reporting).

But sometimes we want to make human choices about a range of options that are in no way related to the object, but that need feeding to the report.  Excellent, now a wizard is appropriate.  So what might those options be.  With my sale.order example I struggle to think of one.  So lets blur the lines a wee bit.  Stay with me.  A balance sheet report.  Oh but I hear you say, but a balance sheet isn’t an object, and you’d be wrong at least temporarily, but we’ll explain that later, for now we are focusing on options that require human interaction.

So lets take our balance sheet, which is essentially a report of specific parts of our General Ledger, grouped and summed that gives us a snapshot of our businesses assets and liabilities at a point in time.  In other words, we are working with account moves, and accounts.  So what options might we like.  We might want to know what our balance sheet looked like 8 seconds ago, not likely, but more likely what it looked like (or will look like) on a specific date.  We might have multiple companies and want to choose one of them, we might decide we only want to see down to a certain level, or for a certain chart of accounts.  We might want all amounts without cents, or with cents, all accounts, accounts with balances only.  Now once we start to go through the options we see that there are many possible combinations of these attributes and really only attributes that the user can determine.

So our balance sheet wizard might look like this.  Taken from account_account_extension_o4sb found at apps.openerp.com .

Balance Sheet Wizard

Great Wizard, no hat

So next time we’ll dig in to this a little deeper, explain our other uses for wizards in reporting and maybe look at some code.

One Comment

  1. ehcanadian says:

    Keep up the posts on OpenERP; they’re appreciated!

Leave a Reply

You must be logged in to post a comment.