ZestyBeanz Technologies Pvt Ltd 4th Floor, Nila, Technopark Thiruvananthapuram,
India – 695581
Phone: +91 471 4063254
Fax : +91 471 2700171


ZestyBeanz Technologies Pvt Ltd
61/3236, Manikkath Cross Road
Ravipuram, Kochi, India - 682016
Phone: +91 484 4063254


Zesty Labs
Office # 2003, Millennium Plaza Building
Sheikh Zayed Rd, Dubai, UAE
Phone: +971 4333 2222​
Mobile: +971-52-7553466


ZestyBeanz Technologies GmbH
Reuterstraße 1
90408 Nürnberg
Fon: +49 911 4801 444
Fax: +49 911 4801 445

Sales Analysis Report

Contact Form

Gopakumar N G's picture

Sales Analysis Report

Are you interested in getting the sales details of your firm from anywhere you go . If you want to check out the trend of your business for a month or in the current year, if you need the sales details of particular product or category at the moment in a precise way, OpenERP provides these functionalities with analysis report and graph views.

  Analysis reports are used for creating dynamic reports in OpenERP. The advantages of analysis reports are:


  • We can select the report based on the search view filters. For example Sales Analysis report can be generated for a Salesperson, Partner, Product, Shop, Quotations etc.

  • Values can be directly copy pasted to an excel or csv file, where proper alignment will be got automatically.

  • Reports can be generated in the form of graphs.


For creating the Sales Analysis report, there should be a model defined for it. OpenERP objects can be created from PostgreSQL views. The technique is as follows : 


  1. Declare your _columns dictionary. All fields must have the flag readonly=True.

  2. Specify the parameter _auto=False to the OpenERP object, so no table corresponding to the _columns dictionary is created automatically.


  3. Add a method init(self, cr) that creates a PostgreSQL View matching the fields declared in _columns.


    For the model ‘’ data is taken from a view defined in the init method of the model. The value for each field is calculated dynamically, that is at the time we click on the menuitem for the Sales Analysis report in Reporting tab. The aliases in the select query of the view creation are the field names of the model sale_report. For example in select query you can find

                                            l.uom_id as product_uom

    where product_uom is column in the model ‘sale_report’.

    Next step is to define the tree, graph and search view for the model.


    1. Tree view


    In the tree view, there is an attribute in the <tree> tag that is create="false". This is used for hiding the create button in the tree view.

    2. Graph view

    The default type of the graph is a pie chart - to change it to a barchart change, type=”bar” in the graph tag.
    The first field is the X axis. The second one is the Y axis and the optional third one is the Z axis for 3 dimensional graphs. You can apply a few attributes to each field/axis:
                           1. group: if set to true, the client will group all item of the same value for this field. For each other                                    field, it will apply an operator.
                           2. operator: the operator to apply is another field is grouped. By default it's '+'.
                               Allowed values are:
                                            a. +: addition
                                            b. *: multiply
                                            c. **: exponent
                                            d. min: minimum of the list
                                            e. max: maximum of the list
    3. Search View   

    Now define an action for the views

    Add necessary menuitems so that the Sales Analysis report should be displayed under the Reporting tab.

    In the web client goto Reporting -> Sales -> Sales Analysis and you can find the tree view as



    Both of these can be viewed based on the filters defined in the search view. For example adding the filters product and shop the views will be like the following


    You can also view/download the details as csv in the graph view by using Graph Options button.




Anonymous's picture

Hi, I Notice one of your


I Notice one of your order analysis page shows cost price & total cost column, which is not the default case. I just followed

unfortunately I keep getting issue, where cost_price is not exist in pos order model - what am i missing? can anyone help?

ProgrammingError: column report_pos_order.cost_price does not exist
LINE 1: ...ort_pos_order"."product_qty") AS product_qty, sum("report_po...

using Openerp7;

Anonymous's picture

Sometimes I loose my patience

Sometimes I loose my patience so fast.
Just updating the db - its working fine.