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.

0

I dont know Why my report is not working

By
Ibrar Ahmad
on 1/9/16, 4:35 AM 323 views

Module tailor_master:

    _init_.py

    _openerp_.py

    tailor.py

    tailor_view.xml

    report_tailor.xml


                                                                                                  init.py:

# -*- coding: utf-8 -*-

import tailor

                                                                                           _openerp_.py

{

'name' : 'Tailor Master',

'version' : '0.1',

'author' : 'Sohaib Rafiq',

'sequence': 110,

'category': 'Management',

'website' : 'https://www.greencity.com.pk',

'summary' : 'Tailor Master',

'description' : """

A module for Tailor Master Business Management

""",

'depends' : [

'base','sale'

],

'data' : [

'tailor_view.xml',

'report_tailor.xml',

],

'demo': [],

'installable' : True,

'application' : True,

}

                                                                     tailor_view.xml

<?xml version="1.0" encoding="utf-8"?>

<openerp>

<data>

<!-- Form view of Tailor Master -->

<record id="view_form_tmaster" model="ir.ui.view">

<field name="name">view.form.tmaster</field>

<field name="model">tmaster.model</field>

<field name="arch" type="xml">

<form string="" version="8.0">

<sheet>

<group>

<h1>

<field name="name" required="1" placeholder="Either choose One or Create New Customer" help="Customer Name"/>

</h1>

</group>

<separator string ="Order" colspan="4"/>

<group colspan="4" col="6">

<field name="order"/>

<field name="dealer"/>

<field name="choose" widget="selection"/>

<field name="odate"/>

<field name="pdate"/>

<field name="active"/>

<field name="shirt"/>

<field name="kurta"/>

<field name="trouser"/>

<field name="monogram"/>

<field name="oversize"/>

</group>

<group colspan="4" col="2">

<field name="fitting" widget="selection"/>

</group>

<separator string ="Size" colspan="4"/>

<group colspan="4" col="4">

<field name="neck"/>

<field name="tail"/>

<field name="chest"/>

<field name="yoke"/>

<field name="waist"/>

<field name="hip"/>

<field name="lsleeve"/>

<field name="rsleeve"/>

<field name="lwrist"/>

<field name="rwrist"/>

</group>

<group colspan="4" col="2">

<field name="dneck" widget="selection"/>

<field name="dsleeve" widget="selection"/>

<field name="dpocket" widget="selection"/>

<field name="dfront" widget="selection"/>

<field name="dback" widget="selection"/>

</group>

</sheet>

</form>

</field>

</record>

<!-- Tree view of Tailor Master -->

<record id="view_tree_tmaster" model="ir.ui.view">

<field name="name">view.tree.tmaster</field>

<field name="model">tmaster.model</field>

<field name="arch" type="xml">

<tree string="Measurements">

<field name="name"/>

<field name="active"/>

</tree>

</field>

</record>

<!-- Calendar View of Tailor Master -->

<record id="view_calendar_tmaster" model="ir.ui.view">

<field name="name">view.calendar.tmaster</field>

<field name="model">tmaster.model</field>

<field name="arch" type="xml">

<calendar string="Tailor Master" date_start="odate" date_stop="pdate" color="name" event_open_popup="$(action_tmaster)d">

<field name="name"/>

</calendar>

</field>

</record>

<!-- Action of Tailor Master-->

<record id="action_tmaster" model="ir.actions.act_window">

<field name="name">Records</field>

<field name="res_model">tmaster.model</field>

<field name="view_type">form</field>

<field name="view_mode">tree,form,calendar</field>

</record>

<menuitem id="menu_tailor" name="Tailor"/>

<menuitem id="measurements" name="Measurements" parent="menu_tailor"/>

<menuitem id="record" action="action_tmaster" parent="measurements"/>

<menuitem id="base.menu_sales" name="Sales Order" parent="menu_tailor"/>

<menuitem id="base.menu_product" name="Products" parent="menu_tailor"/>

<report

id="custom_report_tailor"

model="tmaster.model"

string="tailor"

report_type="qweb-pdf"

name="tailor_master.report_tailor"

attachment_use="False"

file="tailor_master.report_tailor"

/>

</data>

</openerp>

                                                                                        report_tailor

         

<?xml version="1.0" encoding="utf-8"?>

<!--Custom report.-->

<openerp>

<data>

<template id="report_tailor_document">

<t t-call="report.external_layout">

<div class="page">

<div class="row">

<h3>Title</h3>

</div>

</div>

</t>

</template>

<template id="report_tailor">

<t t-call="report.html_container">

<t t-foreach="doc_ids" t-as="doc_id">

<t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'report_tailor_document')"/>

</t>

</t>

</template>

</data>

</openerp>


Report is shown under print button like this

https://www.facebook.com/photo.php?fbid=10203869452137042&set=ms.c.eJwzNDAyMLYwszQxNTI0NjcwMdIzhIuYGZqbG5oYAwB~_IwcL.bps.a.10203869450777008.1073741836.1842948828&type=3&theater

When tried to print, The following error occured:

https://www.facebook.com/photo.php?fbid=10203869456177143&set=ms.c.eJwzNDAyMLYwszQxNTI0NjcwMdIzhIuYGZqbG5oYAwB~_IwcL.bps.a.10203869450777008.1073741836.1842948828&type=3&theater


 





0
Swapnesh
On 1/9/16, 9:58 AM

Hello,

<report

    id="custom_report_tailor"

    model="tmaster.model"

    string="Print Tailor"

    report_type="qweb-pdf"

    name="tailor_master.report_tailor"

    attachment_use="False"

    file="tailor_master.report_tailor"

>



 report_tailor


Please try to Print Using this code


<?xml version="1.0" encoding="utf-8"?>

<!--Custom report.-->

<openerp>

<data>

<template id="report_tailor">

<t t-call="report.external_layout">

<div class="page">

<div class="row">

<h3>Title</h3>

</div>

</div>

</t>

<t t-call="report.html_container">

<t t-foreach="doc_ids" t-as="doc_id">

<t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'report_tailor_document')"/>

</t>

</t>

</template>

</data>

</openerp>






Thanks

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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 1/9/16, 4:35 AM
Seen: 323 times
Last updated: 1/9/16, 9:58 AM