-
Notifications
You must be signed in to change notification settings - Fork 51
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
T1894 improve error messages on scan import letters #1986
base: 14.0
Are you sure you want to change the base?
T1894 improve error messages on scan import letters #1986
Conversation
… True on analysis failure
…not pass the test
… passes to failed
Quality Gate passedIssues Measures |
self.import_completed = False | ||
self.failed_file_name = file_name | ||
self.state = "failed" | ||
self.env.user.notify_danger(f"Couldn't import file {file_name}") | ||
self._compute_state = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A call to the write method is preferable when changing many values at the same time. Also assigning the compute method seems wrong.
self.import_completed = False | |
self.failed_file_name = file_name | |
self.state = "failed" | |
self.env.user.notify_danger(f"Couldn't import file {file_name}") | |
self._compute_state = False | |
self.write({ | |
"import_completed": False, | |
"failed_file_name": file_name, | |
"state": "failed" | |
}) | |
self.env.user.notify_danger(f"Couldn't import file {file_name}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when I remove the line "self._compute_state = False" the import is recalculated and the import state is set to ready instead of failed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you then please put this as a comment above the line in order to explain the reason of this line? Otherwise won't understand and may remove it in the future.
improve error messages on scan import letters