Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
3016 Lượt xem

User wants to use the Export to XLXS facility and encountered error below:


Odoo Server Error
Traceback (most recent call last):
  File "/odoo/odoo-server/addons/account_reports/controllers/main.py", line 34, in get_report
    response.stream.write(report_obj.get_xlsx(options))
  File "/odoo/custom/addons/account_financial_reports/models/profit_loss_inherit.py", line 347, in get_xlsx
    index, y_offset, account_total = print_foldable_line(lines, y+1, y_offset, parent_line, {})
  File "/odoo/custom/addons/account_financial_reports/models/profit_loss_inherit.py", line 324, in print_foldable_line
    index, y__offset, value_dict = print_foldable_line(lines, line_index + 1, y_offset, lines[line_index], {})
  File "/odoo/custom/addons/account_financial_reports/models/profit_loss_inherit.py", line 324, in print_foldable_line
    index, y__offset, value_dict = print_foldable_line(lines, line_index + 1, y_offset, lines[line_index], {})
  File "/odoo/custom/addons/account_financial_reports/models/profit_loss_inherit.py", line 324, in print_foldable_line
    index, y__offset, value_dict = print_foldable_line(lines, line_index + 1, y_offset, lines[line_index], {})
  [Previous line repeated 526 more times]
  File "/odoo/custom/addons/account_financial_reports/models/profit_loss_inherit.py", line 275, in print_foldable_line
    if lines[line_index].get('caret_options') and lines[line_index].get('parent_id') == parent_line.get('id'):
IndexError: list index out of range


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,


Index error occurs when try to access an element from a list or tuple from an index that is not present in the list.


in the if condition, accessing the data of index 'line_index' from the lines. the index is not present in the list or tuple.


Hope this helps


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 4 25
598
2
thg 12 20
4045
1
thg 7 25
1423
2
thg 7 25
393
0
thg 6 25
8