diff --git a/l10n_br_sale/models/sale_order.py b/l10n_br_sale/models/sale_order.py index 15f2d34d52b4..6026eabb62a8 100644 --- a/l10n_br_sale/models/sale_order.py +++ b/l10n_br_sale/models/sale_order.py @@ -164,9 +164,12 @@ def _create_invoices(self, grouped=False, final=False, date=None): moves |= super()._create_invoices( grouped=grouped, final=final, date=date ) - except UserError: - # TODO: Avoid only when it is "nothing to invoice error" - pass + except UserError as e: + if "There is nothing to invoice!" in str(e): + # Skip for now, will review later + pass + else: + raise if not moves and self._context.get("raise_if_nothing_to_invoice", True): raise UserError(self._nothing_to_invoice_error_message())