This question has been flagged
2 Replies
3900 Views

Hello

I have a problem printing invoices, every time I take a imprimr invoice shows the following error

'NoneType' object has no attribute 'data'

(<type 'exceptions.attributeerror'="">, AttributeError("'NoneType' object has no attribute 'data'",), <traceback object="" at="" 0x7f79a8229c20="">)

Avatar
Discard
Best Answer

Maybe there is a problem in wizard or in your rml file you are using data to fetch desired values, try to just print [[ data ]].If it does not print anything,then there is a problem in wizard. Are you generating report by wizard? Because if you generating report by wizard, the wizard method returns the dictionary of the following keys & values : Suppose wizard method is like this,

def print_report(self, cr, uid, ids, context=None):
        """
         To get the date and print the report
         @param self: The object pointer.
         @param cr: A database cursor
         @param uid: ID of the user currently logged in
         @param context: A standard dictionary
         @return: return report
        """
        if context is None:
            context = {}
        datas = {'ids': context.get('active_ids', [])}

        res = self.read(cr, uid, ids, ['employee_ids',  'date_from', 'date_to', 'salary_on'], context=context)
        res = res and res[0] or {}
        datas['form'] = res
        datas['ids'] = res.get('employee_ids',[])
        return {
            'type': 'ir.actions.report.xml',
            'report_name': 'year.salary',
            'datas': datas,
       }

In datas we have passed employee_ids, datas must consists list of ids. Maybe this will help you.

Avatar
Discard
Author Best Answer

Hello again does not work if I press the preview button in the page header company information same if I new database, use OpenERP 7 with the latest nightly build

thanks

Avatar
Discard

Are you using base_report_designer module for report? Are you trying to open pdf report? Have you use word [[ data ]] in your rml file?

Author

Hello can not find any rml file in the folder of my installation, only the branch addons

Author

creo que el problema viene de ReportLab, el archivo utils.py no recibe datos para convertir en pdf puede ser?

Author

sorry, I think the problem comes from ReportLab, utils.py file not receive data to convert into pdf may be?