← Back to team overview

report-openoffice-team team mailing list archive

[Merge] lp:~c2c/report-openoffice/trunk_compatibility into lp:report-openoffice

 

Nicolas Bessi - Camptocamp has proposed merging lp:~c2c/report-openoffice/trunk_compatibility into lp:report-openoffice.

Requested reviews:
  Report OpenOffice Team (report-openoffice-team)


Fix of bug 600175
-- 
https://code.launchpad.net/~c2c/report-openoffice/trunk_compatibility/+merge/28908
Your team Report OpenOffice Team is requested to review the proposed merge of lp:~c2c/report-openoffice/trunk_compatibility into lp:report-openoffice.
=== modified file 'report_openoffice/report_openoffice.py'
--- report_openoffice/report_openoffice.py	2010-06-10 07:04:36 +0000
+++ report_openoffice/report_openoffice.py	2010-06-30 15:49:24 +0000
@@ -418,7 +418,7 @@
         report_type = report_xml.report_type
         if report_type in ['sxw','odt']:
             fnct = self.create_source_odt
-        elif report_type in ['pdf','raw','html','oo-pdf']:
+        elif report_type in ['oo-pdf']:
             fnct = self.create_source_pdf
         elif report_type=='html2html':
             fnct = self.create_source_html2html
@@ -426,7 +426,7 @@
             #fnct = self.create_relatorio_report
             fnct = self.create_source_odt
         else:
-            raise ReportTypeException(_('Unknown report type: %s') % report_type)
+            return super(OpenOffice_parser, self).create(cursor, uid, ids, data, context)
         return fnct(cr, uid, ids, data, report_xml, context)
 
 class ReportTypeException(Exception):

=== modified file 'report_openoffice/report_view.xml'
--- report_openoffice/report_view.xml	2010-04-15 11:40:37 +0000
+++ report_openoffice/report_view.xml	2010-06-30 15:49:24 +0000
@@ -2,7 +2,7 @@
 <openerp>
     <data>
 
-		<record model="ir.ui.view" id="act_report_xml_view2">
+		<record model="ir.ui.view" id="base.act_report_xml_view">
 			<field name="name">ir.actions.report.xml</field>
 			<field name="model">ir.actions.report.xml</field>
             <field name="priority">15</field>

=== modified file 'report_openoffice/report_xml.py'
--- report_openoffice/report_xml.py	2010-06-10 07:04:36 +0000
+++ report_openoffice/report_xml.py	2010-06-30 15:49:24 +0000
@@ -61,6 +61,15 @@
 class report_xml(osv.osv):
     _name = 'ir.actions.report.xml'
     _inherit = 'ir.actions.report.xml'
+    
+    def __init__(self, pool, cr):
+        """Nasty hack for other report compatibility due 
+        to the inexistance of selection fields inheritance mechanism"""
+        super(report_xml, self).__init__(pool, cr)
+        if ('oo-odt', 'OpenOffice - odt/ods output') not in self._columns['report_type'].selection :
+            self._columns['report_type'].selection.append(
+                                        ('oo-odt', 'OpenOffice - odt/ods output'),
+                                )
 
     def _report_content(self, cursor, user, ids, name, arg, context=None):
         res = {}
@@ -80,15 +89,6 @@
             self.write(cursor, user, id, {name+'_data': value}, context=context)
 
     _columns = {
-        'report_type': fields.selection([
-            ('pdf', 'pdf'),
-            ('html', 'html'),
-            ('raw', 'raw'),
-            ('sxw', 'sxw'),
-            ('odt', 'odt'),
-            ('html2html','Html from html'),
-            ('oo-odt', 'OpenOffice - odt/ods output'),
-            ], string='Type', required=True),
         'styles_mode': fields.selection([
             ('default','Not used'),
             ('global', 'Global'),