Odoo Help

0

I created a custom report of sales quotation. But the original quotation report is displaying in my quotation button. Code is posted here.Any one plz help

By
rosey
on 11/24/14, 2:50 AM 1,056 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.

0
Ivan
On 11/24/14, 4:05 AM

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.

0
Bole
On 11/24/14, 4:06 AM

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 :)

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

rosey
on 11/24/14, 5:15 AM

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

Bole
on 11/24/14, 6:24 AM

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

rosey
on 11/24/14, 7:23 AM

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.

Register

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)

Stats

Asked: 11/24/14, 2:50 AM
Seen: 1056 times
Last updated: 3/16/15, 8:10 AM