Odoo Help

0

Replace standard report with WebKit

By
Paul Catinean
on 9/2/13, 3:52 AM 2,498 views

My task would be to seamlessly insert the custom webkit report in place of the standard one for multiple objects (sale.order, stock.picking.out, mrp.production etc)

The best way to do this would be to use the same id as the standard report thus overriding it and adding your webkit-related data to it.By doing this you ensure all actions, buttons, wizards which point to the original report will now point to yours and rid you of useless overriding of actions

The problem with this is that if you override the actual report instead of replacing the old one like I did, the webkit headers are not found anymore and the standard c2c one is used.This forces me to rename the original one and use the same report name in the newly created one

<report auto="False" 
        id="sale.report_sale_order" 
        model="sale.order" 
        name="sale.order.standard"
        rml="sale/report/sale_order.rml" 
        string="Quotation / Order"
        usage=""/>
    <report id="custom_webkit_quotation_report"
        auto="False"
        model="sale.order"
        name="sale.order"
        file="custom_reports/report/templates/report_quotation.mako"
        string="Quotation / Order"
        usage="default"
        report_type="webkit" />

This might also have to do with the parser and the parser name (Which cannot be overriden to my knowledge)

class report_quotation(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(report_quotation, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, 'cr': cr, 'uid': uid, })

report_sxw.report_sxw('report.webkit.quotation', 'sale.order', 'addons/custom_reports/report/templates/report_quotation.mako', parser=report_quotation)

Ai takers on this one?

Thank you

2

Ray Carnes

--Ray Carnes--
16349
| 9 7 9
Greater Los Angeles, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0; Odoo 8.0, 9.0, 10.0.

Completed Odoo Functional and Technical Training.

Major Skills:

  • User Needs and GAP Analysis;

  • Functional and Technical Design;

  • Prototyping and Proof of Concepts;

  • Requirements Specifications;

  • Agile Implementation;

  • Data Migration;

  • Configuration & Customization (UI and code);

  • Integration - Odoo and non Odoo Applications and Services;

  • Training and Knowledge Transfer;

  • Go Live Support;

  • Helpdesk;

  • Version Upgrades and Migration.

  • Accounting Expert.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

I am a skilled Communicator and I only take the serious things seriously!

Ray Carnes
On 9/26/13, 3:08 PM

That does provide good insight, nonetheless it does not replace the report it just makes a new one default, hence the buttons launching the initial report by name will still trigger the old one.

Thank you for posting the link Ray!

Paul Catinean
on 9/27/13, 6:34 AM
0
Paul Catinean
On 9/25/13, 3:17 PM

One solution would be to remove the standard report before adding in your custom one with the same name:

 report_sxw.report_sxw.remove('report.sale.order')

Would like a more elegant solution, like updating it or something...but at least this works

EDIT:

A even better one is to edit the report in place:

   netsvc.Service._services['report.sale.order'].parser=custom_parser_class
   netsvc.Service._services['report.sale.order'].tmpl='addons/module/webkit_quotation.mako'

The only problem I have left is that the attachment is downloaded with the previous name, other than that it seems fine!

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.

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

0 follower(s)

Stats

Asked: 9/2/13, 3:52 AM
Seen: 2498 times
Last updated: 3/16/15, 8:10 AM