[IMP] ir.actions.report.xml views/models adapted for report_type controller
authorSimon Lejeune <sle@openerp.com>
Fri, 21 Mar 2014 18:47:39 +0000 (19:47 +0100)
committerSimon Lejeune <sle@openerp.com>
Fri, 21 Mar 2014 18:47:39 +0000 (19:47 +0100)
bzr revid: sle@openerp.com-20140321184739-0dmft3odaws85m7e

openerp/addons/base/ir/ir_actions.py
openerp/addons/base/ir/ir_actions.xml

index 7b0681f..2ead3d8 100644 (file)
@@ -141,12 +141,12 @@ class ir_actions_report_xml(osv.osv):
         'model': fields.char('Model', required=True),
         'report_type': fields.selection([('qweb-pdf', 'PDF'),
                     ('qweb-html', 'HTML'),
-                    ('other', 'Other'),
+                    ('controller', 'Controller'),
                     ('pdf', 'RML pdf (deprecated)'),
                     ('sxw', 'RML sxw (deprecated)'),
                     ('webkit', 'Webkit (deprecated)'),
-                    ], 'Report Type', required=True, help="PDF will use wkhtmltopdf to render html to pdf, HTML will directly show html, Other will force download the controller output keeping the MIME type."),
-        'report_name': fields.char('Controller Name', required=True, help="URL of the report will be /report/<controller name>/<ids>, the default controller also use this field to get the name of the qweb ir.ui.view to render. For RML reports, this is the LocalService name."),
+                    ], 'Report Type', required=True, help="PDF will use wkhtmltopdf to render html to pdf, HTML will directly show html,."),
+        'report_name': fields.char('Template Name', required=True, help="For QWeb reports, name of the template used in the rendering. The method 'render_html' of the model 'report.template_name' will be called (if existing) to give the html. For RML reports, this is the LocalService name."),
         'groups_id': fields.many2many('res.groups', 'res_groups_report_rel', 'uid', 'gid', 'Groups'),
 
         # options
@@ -163,7 +163,7 @@ class ir_actions_report_xml(osv.osv):
         'report_xsl': fields.char('XSL Path'),
         'report_xml': fields.char('XML Path'),
 
-        'report_rml': fields.char('Main Report File Path', help="The path to the main report file (depending on Report Type) or NULL if the content is in another data field"),
+        'report_rml': fields.char('Main Report File Path/controller', help="The path to the main report file/controller (depending on Report Type) or NULL if the content is in another data field"),
         'report_file': fields.related('report_rml', type="char", required=False, readonly=False, string='Report File', help="The path to the main report file (depending on Report Type) or NULL if the content is in another field", store=True),
 
         'report_sxw': fields.function(_report_sxw, type='char', string='SXW Path'),
index 77d7eb2..767c695 100644 (file)
@@ -59,7 +59,8 @@
                             <field name="name"/>
                             <field name="model"/>
                             <field name="report_type"/>
-                            <field name="report_name"/>
+                            <field name="report_name" attrs="{'invisible':[('report_type','=', 'controller')]}"/>
+                            <field name="report_rml" attrs="{'invisible':[('report_type','!=', 'controller')]}"/>
                         </group>
                         <group>
                             <field name="multi"/>