Issue 11588

Title
None values crashes on vat_book_es report
Priority
bug
Status
testing
Nosy list
acaubet, pokoli, reviewbot
Assigned to
acaubet
Keywords
backport, review

Created on 2022-07-05.13:44:41 by acaubet, last changed yesterday by reviewbot.

Messages

Author: [hidden] (acaubet)
Date: 2022-07-06.12:56:13

Another crash we found with a party with null name:

Traceback (most recent call last):
  File "/trytond/wsgi.py", line 117, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/trytond/protocols/dispatcher.py", line 46, in rpc
    return methods.get(request.rpc_method, _dispatch)(
  File "/trytond/wsgi.py", line 84, in auth_required
    return wrapped(*args, **kwargs)
  File "/trytond/protocols/wrappers.py", line 159, in wrapper
    return func(request, pool, *args, **kwargs)
  File "/trytond/protocols/dispatcher.py", line 180, in _dispatch
    result = rpc.result(meth(*c_args, **c_kwargs))
  File "/trytond/report/report.py", line 215, in execute
    oext, content = cls._execute(
  File "/trytond/report/report.py", line 233, in _execute
    return cls.convert(action, cls.render(action, report_context))
  File "/trytond/modules/account_es/reporting_tax.py", line 911, in render
    return cls.render_csv(report, report_context)
  File "/trytond/modules/account_es/reporting_tax.py", line 945, in render_csv
    writer.writerow(cls.get_row(record, report_context))
  File "/trytond/modules/account_es/reporting_tax.py", line 972, in get_row
    record.party.name[:40],
TypeError: 'NoneType' object is not subscriptable

Fault: 'NoneType' object is not subscriptable
Author: [hidden] (acaubet)
Date: 2022-07-05.13:44:40

Create a new invoice with no lines, create a new invoice tax line with some taxes. Post it.
Later on in account.reporting.aeat.vat_book report crashes as don't have any base_amount:

TypeError: conversion from NoneType to Decimal is not supported
  File "trytond/protocols/dispatcher.py", line 180, in _dispatch
    result = rpc.result(meth(*c_args, **c_kwargs))
  File "trytond/report/report.py", line 216, in execute
    groups[0], headers[0], data, action_report)
  File "trytond/report/report.py", line 233, in _execute
    return cls.convert(action, cls.render(action, report_context))
  File "trytond/modules/account_es/reporting_tax.py", line 911, in render
    return cls.render_csv(report, report_context)
  File "trytond/modules/account_es/reporting_tax.py", line 945, in render_csv
    writer.writerow(cls.get_row(record, report_context))
  File "trytond/modules/account_es/reporting_tax.py", line 975, in get_row
    cls.format_decimal(record.base_amount),
  File "trytond/modules/account_es/reporting_tax.py", line 927, in format_decimal
    n = Decimal(n)
History
Date User Action Args
2022-08-11 14:45:42reviewbotsetmessages: + msg77677
2022-08-11 12:43:36reviewbotsetmessages: + msg77664
2022-07-06 13:03:27reviewbotsetmessages: + msg77281
2022-07-06 13:02:54acaubetsettitle: None crashes on vat_book_es report -> None values crashes on vat_book_es report
2022-07-06 13:02:41acaubetsettitle: None conversion to Decimal in vat_book_es -> None crashes on vat_book_es report
2022-07-06 12:56:13acaubetsetmessages: + msg77280
2022-07-05 15:07:48reviewbotsetmessages: + msg77277
2022-07-05 14:11:04reviewbotsetmessages: + msg77276
nosy: + reviewbot
2022-07-05 13:58:23pokolisetkeyword: + backport
nosy: + pokoli
2022-07-05 13:47:09acaubetsetstatus: in-progress -> testing

Showing 10 items. Show all history (warning: this could be VERY long)