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] fetchmail_attach_from_folder: be able to open form view even when connection fails #3160

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
7 changes: 6 additions & 1 deletion fetchmail_attach_from_folder/models/fetchmail_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import re

from odoo import _, api, fields, models
from odoo.exceptions import UserError

_logger = logging.getLogger(__name__)

Expand All @@ -30,7 +31,11 @@
if this.state != "done":
this.folders_available = _("Confirm connection first.")
continue
connection = this.connect()
try:
connection = this.connect()
except UserError:
this.folders_available = _("Confirm connection first.")
continue

Check warning on line 38 in fetchmail_attach_from_folder/models/fetchmail_server.py

View check run for this annotation

Codecov / codecov/patch

fetchmail_attach_from_folder/models/fetchmail_server.py#L34-L38

Added lines #L34 - L38 were not covered by tests
list_result = connection.list()
if list_result[0] != "OK":
this.folders_available = _("Unable to retrieve folders.")
Expand Down
Loading