Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
2 Vastaukset
13052 Näkymät

'bool' object has no attribute 'startswith': (<type 'exceptions.AttributeError'>, AttributeError("'bool' object has no attribute 'startswith'",), <traceback object at 0x7fe239e4f440>)

I can't understand what this error means.

here's the code on my wizard:

def print_excel(self, data):

context = self._context

datas = {'ids': context.get('active_ids', [])}

datas['model'] = 'this.bank.info'

datas['form'] = self.read()[0]

return {'type': 'ir.actions.report.xml',

'report_name': 'bank_module.bank_summary.xlsx',

'datas': datas,

'name': 'Bank Summary'

}

This is from my report:

class BankSumXls(ReportXlsx):

def generate_xlsx(self, workbook, data, lines):

BankAdviceSumXls('report. bank_module.bank_summary.xlsx , 'this.bank.info')



I just want to print an atleast empty sheet for now. please help me. Thanks in advance

Avatar
Hylkää

you're probably have no data in in the dict so it's false and that is why it thinks it' Boolean

Tekijä Paras vastaus

I solved this already, There is a missing xml file. that's why it can't see the template i'm trying to access. 

<report

            id="summary_xlsx"

            model="bank.module"

            string="Print to XLSX"

            report_type="xlsx"

            name="mod_name.summary.xlsx"

            file="mod_name.summary.xlsx"

            attachment_use="False"

            menu="False"

        />

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
2
marrask. 15
6924
1
heinäk. 21
4685
1
marrask. 16
4367
2
kesäk. 16
6507
1
maalisk. 15
6246