Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

2

OpenERP Report Creation for Beginners [Closed]

By
priyankahdp
on 5/17/13, 6:19 AM 11,442 views

The Question has been closed

by
Serpent Consulting Services Pvt. Ltd.
on 11/20/2013 00:29:41

I'm going to create reports for my module from OpenERP 7. as per forums i used Web kit Report method.

first, from using below command i installed wkhtmltopdf on my machine.

sudo apt-get install wkhtmltopdf

its installed. now when i type in terminal its show location path also.

$ which wkhtmltopdf
/usr/bin/wkhtmltopdf

I'm installed Web kit Report module in OpenERP 7.then how to start report create process.? is there any tutorial,blog,post,video to follow ? or can any one please tell me steps for that.

thanks

14

Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
4341
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 5/17/13, 9:39 AM

Hello,

Step 1:

(1) In webkit report you have to be aware of html because webkit engine used mako tamplate.

(2) First of all you need to install the webkit report module report_webkit.

(3) You need to set wkhtmltopdf file path for that you have to go to Setting/Technical/Parameters/System parameter

(4) Create new parameter and give key = webkit_path and value = wkhtmltopdf file path

STEP 2 : Here we provide some basic step to WebKit report.

WebKit Report:module

   • report folder

        1. __init__.py

        2. report.py

        3. report.mako

        4. report.xml

__init__.py init file for import the .py file in report directory.

       :- .mako
           mako is a template library written in python, 
           WebKit library to support reports designed 
           in HTML + CSS.

       :- .py
           To generate the pdf from mako file, openEPR 
           needs a parser for generate a reports.
           In .py file we write a code of parser.

      :- .xml
         we declare a report in .xml file.

This is my webkit.py file

import sale_order

import time

from openerp.report import report_sxw

class order(report_sxw.rml_parse):

def __init__(self, cr, uid, name,context=None):

       super(order, self).__init__(cr, uid, name, context=context)
       self.localcontext.update({
                 'time': time, })
       report_sxw.report_sxw('report.sale.webkit.order',sale_order_webkit.mako',  'sale.order', 'addons/webkit_sale/report/ parser=order, header="external")

This is my webkit.xml file

<openerp>

<data>

    <report auto="False"
     id="report_sale_order"
     model="sale.order"
    name="sale.webkit.order"
    file="webkit_sale/report/sale_order_webkit.mako"
    string="Quotation / Order"
    report_type="webkit"/>

</data>

</openerp>

This is my mako file. <html>

<head>
    <style>
            ${css}
    </style>
</head>
<body>
This is my web-kit report
</body>
 </html>

Thank You,

Serpent Consulting Services Pvt. Ltd.

thanks soooo much dear friend :-)

priyankahdp
on 5/17/13, 12:37 PM

Does anyone know if this still works under V8?

Yakito
on 2/3/15, 2:36 PM

plz yakito didi you get any answer to your question. Need your help plz

Drees Far
on 12/19/15, 2:48 PM

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 5/17/13, 6:19 AM
Seen: 11442 times
Last updated: 3/16/15, 8:10 AM