Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

button gets greyed out after pressing

By
Christian
on 7/9/13, 11:37 AM 665 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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 7/9/13, 11:37 AM
Seen: 665 times
Last updated: 3/16/15, 8:10 AM