Odoo Help


How to build HTML report from scratch

Dr Obx
on 10/29/15, 6:58 AM 498 views

Guys, how to create HTML report from scratch.

Whatever I do it gives me only error messages.

Tried to use forms from other modules .... same result. Is there any manual how to achieve it ?

Are you asking how to create Qweb reports or how to parse HTML fields into a report or? Gives us some more details.

on 10/29/15, 7:01 AM
Dr Obx
On 10/29/15, 7:57 AM

I would like to change xml/xsl report a'm currently using to the HTML which is much simplier and easier to modify.

Currently using slightly changed report based on product_report.

It would be ok if I can add table header or for example summary at the end.

That's all i actually need. But completely don't understand xml/xsl ... so ....

how can I add table header into the existing form ?



<lot-line type="fields" name="id">

<title type="field" name="name"/>

<quantity type="field" name="qty_available"/>

<location type="field" name="location_id"/>

<available type="field" name="virtual_available"/>





<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">

<xsl:variable name="initial_bottom_pos">20.5</xsl:variable>

<xsl:variable name="initial_left_pos">2.5</xsl:variable>

<xsl:variable name="height_increment">0.5</xsl:variable>

<xsl:variable name="width_increment">1</xsl:variable>

<xsl:variable name="frame_height">8cm</xsl:variable>

<xsl:variable name="frame_width">18cm</xsl:variable>

<xsl:variable name="number_columns">1</xsl:variable>

<xsl:variable name="max_frames">20</xsl:variable>

<xsl:template match="/">

<xsl:apply-templates select="lots"/>


<xsl:template match="lots">


<template leftMargin="2.0cm" rightMargin="1.5cm" topMargin="2.0cm" bottomMargin="2.0cm" title="Address list" author="">

<pageTemplate id="all">


<xsl:apply-templates select="lot-line" mode="frames"/>




<paraStyle name="nospace" fontName="Verdana" fontSize="8" spaceBefore="0" spaceAfter="0"/>

<blockTableStyle id="mytable1">

<blockBackground colorName="lightgrey" start="0,0" stop="0,0"/>

<blockBackground colorName="lightgrey" start="1,0" stop="-1,0"/>

<blockBackground colorName="lightgrey" start="2,0" stop="-1,0"/>


<blockTableStyle id="mytable">

<blockBackground colorName="white" start="0,0" stop="0,0"/>

<blockBackground colorName="lightgrey" start="1,0" stop="2,0"/>

<blockBackground colorName="lightblue" start="2,0" stop="3,0"/>

<blockBackground colorName="lightgreen" start="3,0" stop="4,0"/>




<xsl:apply-templates select="lot-line" mode="story"/>




<xsl:template match="lot-line" mode="frames">

<xsl:if test="position() &lt; $max_frames + 1">


<xsl:attribute name="width">

<xsl:value-of select="$frame_width"/>


<xsl:attribute name="height">

<xsl:value-of select="$frame_height"/>


<xsl:attribute name="x1">

<xsl:value-of select="$initial_left_pos + ((position()-1) mod $number_columns) * $width_increment"/>



<xsl:attribute name="y1">

<xsl:value-of select="$initial_bottom_pos - floor((position()-1) div $number_columns) * $height_increment"/>






<xsl:param name="pmaxChars" as="xs:integer" select="80"/>

<xsl:template match="lot-line" mode="story">

<blockTable style="mytable1" colWidths="12cm,1.5cm,1.5cm,1.5cm">







<xsl:template match="lot-line" mode="story">

<blockTable style="mytable" colWidths="12cm,1.5cm,1.5cm,1.5cm">



<para style="nospace"><xsl:value-of select="title" /></para>



<para style="nospace"><xsl:value-of select="location" /></para>



<para style="nospace"><xsl:value-of select="available" /></para>



<para style="nospace"><xsl:value-of select="quantity" /></para>











Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 10/29/15, 6:58 AM
Seen: 498 times
Last updated: 10/29/15, 7:58 AM