Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][FIX] l10n_br_sale: Tratamento do UserError na criação da Fatura. #3535

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions l10n_br_sale/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,12 @@
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:

Check warning on line 167 in l10n_br_sale/models/sale_order.py

View check run for this annotation

Codecov / codecov/patch

l10n_br_sale/models/sale_order.py#L167

Added line #L167 was not covered by tests
if "There is nothing to invoice!" in str(e):
# Skip for now, will review later
pass

Check warning on line 170 in l10n_br_sale/models/sale_order.py

View check run for this annotation

Codecov / codecov/patch

l10n_br_sale/models/sale_order.py#L170

Added line #L170 was not covered by tests
else:
raise

Check warning on line 172 in l10n_br_sale/models/sale_order.py

View check run for this annotation

Codecov / codecov/patch

l10n_br_sale/models/sale_order.py#L172

Added line #L172 was not covered by tests

if not moves and self._context.get("raise_if_nothing_to_invoice", True):
raise UserError(self._nothing_to_invoice_error_message())
Expand Down
Loading