This question has been flagged
2711 Views

Hi, I have a print button using Aeroo reports as follows:

<button name="print_cube_crushing_certificate" string="Print" states="certified" type="object" icon="gtk-print"/>

the corrsponding function:

def print_cube_crushing_certificate(self, cr, uid, ids, context=None):
  records = self.browse(cr, uid, ids, context=context)
  if records[0].logbook_batch_id.state != 'verified':
     raise osv.except_osv('Error','Batch has not yet been verified')
     return True
  return {
          'type': 'ir.actions.report.xml',
          'report_name': 'CubeCrushing-single',    # the 'Service Name' from the report
          'datas' : {
                     'model' : 'logbook.logbook',    # Report Model
                     'res_ids' : ids
                      }
  }

After pressing the button the pdf gets prepared and the button is greyed out and cannot be pressed again. Even moving to the the next record (in form view) the buttons stays greyed out and cannot be used. I have to go to tree view and than to form view again.

Anyone here who can help? Chris

P.S. I'm using V7 form and the button is in the header but I also tried without the new layout still the button gets inaccesable after the first press

Avatar
Discard