Currently, the error arises when downloading e-Faktur without a 'Tax Number'.
Steps to reproduce:
- Install a 'l10n_id_efaktur' module (with demo data).
- Navigate to Invoicing -> Customers -> Invoices and open any invoice with
an empty 'Tax Number' field.
- Click on the action button to download e-Faktur.
Error: 'bool' object is not subscriptable while evaluating
'action = records.download_efaktur()'
When downloading e-Faktur, There's an issue at [1], Where
the system tries to access elements of 'l10n_id_tax_number', but
'Tax Number' is empty, So 'l10n_id_tax_number' is considered as a 'False'.
[1]: https://github.com/odoo/odoo/blob/9c4194ad3387c55d39ec7bbef1c6414893098c6e/addons/l10n_id_efaktur/models/account_move.py#L168-L170
This commit fixes the above issue by adding a condition to ensure that
the system only accesses an 'l10n_id_tax_number' if it is available.
sentry-5001664034
closesodoo/odoo#162749
X-original-commit: 24e65c2fe904e9a2a4e5004dc0e7ada220d1dacc
Signed-off-by: William André (wan) <wan@odoo.com>