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

printing invoice error

By
Ibercalidad Ingenieros SA
on 4/15/13, 2:42 PM 1,350 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="">)

1

Keyur

--Keyur--
1165
| 4 4 8
Ahmedabad, India
--Keyur--

Odoo Expert

Keyur
On 4/16/13, 3:49 AM

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.

0

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

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?

Keyur
on 4/17/13, 3:34 AM

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

Ibercalidad Ingenieros SA
on 4/17/13, 1:50 PM

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

Ibercalidad Ingenieros SA
on 4/17/13, 2:53 PM

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

Ibercalidad Ingenieros SA
on 4/17/13, 2:57 PM

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

1 follower(s)

Stats

Asked: 4/15/13, 2:42 PM
Seen: 1350 times
Last updated: 3/16/15, 8:10 AM