report-openoffice-team team mailing list archive
-
report-openoffice-team team
-
Mailing list archive
-
Message #00004
[Bug 498716] Re: Adding new reports
Addition to the last message:
If you create the entry into openerp Admin->Low level->Actions->Openoffice reports I've the last problem (unknown record type)
But if you've done the same in the source code all works fine....
An example of quotation for sales order, added to reports_samples.xml:
</record>
<record id="sale.sale_order_test model="ir.actions.report.xml">
<field name="type">ir.actions.report.xml</field>
<field name="report_name">report_openoffice_samples.sale_order_test</field>
<field name="report_type">oo-pdf</field>
<field name="model">sale.order</field>
<field name="report_rml">report_openoffice_samples/templates/quote_test.odt</field>
<field name="name">Quote test</field>
<field name="attachment_use">0</field>
<field name="auto">False</field>
</record>
Additions to reports_samples.py
class sale_order(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(sale_order, self).__init__(cr, uid, name, context)
self.localcontext.update({
'time': time,
})
OpenOffice_parser('report.report_openoffice_samples.sale_order_prodeo',
'sale.order',
'addons/report_openoffice_samples/templates/quote_prodeo.odt',
parser=sale_order,
)
Also I've seen that the report appears in the Sales order, but not in the
Quotation by example, I think this can be a Oerp problem, nor report_openoffice ...
--
Adding new reports
https://bugs.launchpad.net/bugs/498716
You received this bug notification because you are a member of Report
OpenOffice Team, which is the registrant for Report OpenOffice.
Status in OpenOffice.org Reporting Tool for OpenObject: Incomplete
Bug description:
First of all, thanks for this great module Davide...
When I add a new report, I have this error in the server
/usr/local/lib/python2.5/site-packages/openerp-server/report/report_sxw.py:373: DeprecationWarning: raising a string exception is deprecated
raise 'Unknown Report Type'
Unhandled exception in thread started by <function go at 0x9968f44>
Traceback (most recent call last):
File "/usr/local/lib/python2.5/site-packages/openerp-server/service/web_services.py", line 630, in go
(result, format) = obj.create(cr, uid, ids, datas, context)
File "/usr/local/lib/python2.5/site-packages/openerp-server/report/report_sxw.py", line 373, in create
For using this new odt, apart from creating the XML report entry in Actions->Report Openoffice, and creating the tricky Client Action Connections using the id of the report XML (and I see the report only in Invoices, not in Customer Invoices.... I don't know what is the problem), I need modify the report_samples.py
OpenOffice_parser('report.report_openoffice_samples.account_invoice_newreport',
'account.invoice',
'addons/report_openoffice_samples/templates/invoice_newreport.odt',
parser=account_invoice,
)
After this all work fine.
There is a simpler way to do this?