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