Help

2

Getting error while printing xls report for odoo 10

Avatar
Pawan Kumar Sharma

Hello ALL,

i am using Odoo10 and i'm getting following error while print xls report  " Sheetname 'A8', with case ignored, is already in use.: (<type 'exceptions.Exception'>, Exception(u"Sheetname 'A8', with case ignored, is already in use.",), <traceback object at 0x7ff4402f12d8>) ". So, how to solve this problem?

My code is below:

Python: 

from odoo.addons.report_xlsx.report.report_xlsx import ReportXlsx
class PartnerXlsx(ReportXlsx):
    def generate_xlsx_report(self, workbook, data, partners):
        for obj in partners:
            report_name = obj.name
            # One sheet by partner
            sheet = workbook.add_worksheet(report_name[:31])
            bold = workbook.add_format({'bold': True})
            sheet.write(0, 0, obj.name, bold)
PartnerXlsx('report.res.partner.xlsx', 
'res.partner')

Xml:

<odoo>
    <data>
        <report id="partner_xlsx"
                model="res.partner"
                string="Print to XLSX"
                report_type="xlsx"
                name="res.partner.xlsx"
                file="res.partner.xlsx"
                attachment_use="False"/>
    </data>
</odoo>

Thanks in advance



2 Comments
Avatar
Discard
Avatar
Hilar AK
-

please check your object name

Avatar
Kabeer
-

Please check whether you have name 'A8' twice in partner table.