Skip to content

OpenERP Report Flow

January 5, 2013

Creating  a Pdf or Xls Report

Types of Report
1.Normal Report
2.Wizard Report

Wizard
1.Interface
2.Osv Memory

Report creation using Osv Memory
1.wizard.py file for field and function
2.view.xml file for view
3.report.rml file for report (for pdf report)

wizard.py
1.In .py file add the required fields.
2.model name may be like sample.wiz.
3.define function to do action with required queries.
4.make sure rml file has been parsed with reference to it’s name and rml path(For Pdf report).
5.create a binary field to return xls generated(For Xls report).
6.need python-xlwt module installed(For Xls report).
7.write value in worksheet by write value enter row,column and style etc…(For Xls report).
8.Parse writen value as String by using StringIO(For Xls report).
9.encode the string use base64.Encodestring()(For Xls report)..
10.Then return the binary(For Xls report).

view.xml
1.Create a form with required fields.
2.Create a action window to call the form with res.model and view type referring above view.
3.Create a Menu to call the above act window referring above act window.
4.Create a Menu for report make sure the correct rml path and resource model(For Pdf report).

report.rml(For Pdf report)
1.create a rml file.
2.make design changes such as styles,tables,layout etc…..
3.print field by calling objects and regular expression.

Advertisements
One Comment leave one →
  1. Raza Ali permalink
    March 9, 2013 9:29 pm

    Please advise:

    I created a report record via the interface but it doesn’t show up in the print dropdown.

    In settings -> actions -> reports, I added a new record:

    Name: My Test

    Service Name: my_po_reports

    Object: purchase.order

    Report Type: pdf

    Report file: purchase/report/order.rml (i’m reusing an existing one just to test)
    But My Test does NOT show up when I go to purchase order form!

    I also tried the same in aeroo reports without any result:

    In settings -> actions -> aeroo reports -> reports, I added a new record:

    Name: My Test

    Service Name: my_po_report

    Object: purchase.order

    Template type: odt Output type: odt

    Template source: file Template path: myfolder/reports/template.odt
    What am I missing?

    Thanks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: