Browse Source

[FIX] mis_builder: excel export works again... strange

pull/86/head
Stéphane Bidoul 10 years ago
parent
commit
41827e60e9
  1. 13
      mis_builder/models/mis_builder.py
  2. 11
      mis_builder/views/mis_builder.xml

13
mis_builder/models/mis_builder.py

@ -689,6 +689,19 @@ class mis_report_instance(orm.Model):
tools.DEFAULT_SERVER_DATE_FORMAT), tools.DEFAULT_SERVER_DATE_FORMAT),
tformat) tformat)
def preview(self, cr, uid, _id, context=None):
view_id = self.pool['ir.model.data'].get_object_reference(
cr, uid, 'mis_builder', 'mis_report_instance_result_view_form')[1]
return {
'type': 'ir.actions.act_window',
'res_model': 'mis.report.instance',
'res_id': _id[0],
'view_mode': 'form',
'view_type': 'form',
'view_id': view_id,
'target': 'new',
}
def compute(self, cr, uid, _id, context=None): def compute(self, cr, uid, _id, context=None):
assert isinstance(_id, (int, long)) assert isinstance(_id, (int, long))
if context is None: if context is None:

11
mis_builder/views/mis_builder.xml

@ -120,15 +120,6 @@
</field> </field>
</record> </record>
<record model="ir.actions.act_window" id="mis_report_instance_result_action">
<field name="name">Preview</field>
<field name="view_id" ref="mis_report_instance_result_view_form"/>
<field name="res_model">mis.report.instance</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<record model="ir.ui.view" id="mis_report_instance_view_tree"> <record model="ir.ui.view" id="mis_report_instance_view_tree">
<field name="name">mis.report.instance.view.tree</field> <field name="name">mis.report.instance.view.tree</field>
<field name="model">mis.report.instance</field> <field name="model">mis.report.instance</field>
@ -160,7 +151,7 @@
</h1> </h1>
</div> </div>
<div class="oe_right oe_button_box" name="buttons"> <div class="oe_right oe_button_box" name="buttons">
<button type="action" name="%(mis_report_instance_result_action)d" string="Preview" />
<button type="object" name="preview" string="Preview" />
<button type="action" name="%(mis_report_instance_add_to_dashboard_action)d" string="Add to dashboard" /> <button type="action" name="%(mis_report_instance_add_to_dashboard_action)d" string="Add to dashboard" />
</div> </div>
<group col="2"> <group col="2">

Loading…
Cancel
Save