This question has been flagged
2 Replies
3590 Views

Module : quotation

quotation- __openerp__.py

'data': [
            'quotation_report.xml'      
    ],

quotation- quotation_report.xml    

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

        <report auto="False" id="report_quotation_sale" model="sale.order" name="sale.order"
                rml="quotation_report/report/quotation_report.rml" string="Sales Quotation"
                usage="default"/>

    </data>
</openerp>

quotation- report -__init__.py

import quotation

quotation- report - quotation.py

import time
from openerp.report import report_sxw
from openerp.osv import osv
from openerp import pooler

class quotation_report(report_sxw.rml_parse):
    def __init__(self, cr, uid, name, context=None):
        super(quotation_report, self).__init__(cr, uid, name, context=context)
        self.localcontext.update({
            'time': time,
        })
   
report_sxw.report_sxw('sale.order.rndU7tBJ','sale.order','addons/quotation_report/report/quotation_report.rml',parser=quotation_report, header="external")

quotation- report - quotation_report.rml

What was the error in my code? This rml is entirely different from sale quotation report, then how is displaying the same report.

Avatar
Discard
Best Answer

Rosey, are you by any chance use the same Report Name (sale.order) with the original report?  If so, there's the problem.  Report is defined uniquely by it's name.

Avatar
Discard
Best Answer

You did everything right, except you never actualy caaled your report...
As i can se you are dealing with sales orders...
Now, go to sale module, and check sale_order class, method print_quotation -> this is called from button print quotation.. and you need to override this method, 

AND / OR you need to define new or override existing report server action ( print from More menu on top of creen)
(check in module sale:  sale/sale_report.xml )

Hope ti helps :)

Avatar
Discard
Author

I got the button, but its print the original quotation file not my report.

treu.. but you still need to override method that calls print quotation with your parameters (report name, paths etc) so it can call your report instead of standard one..

Author

Thanks for your response Bole. But still i didnt get you.