-
-
Notifications
You must be signed in to change notification settings - Fork 166
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
Make no type count as a type. #36
Conversation
Fix #35. When an event had no type, it was not getting in the mapping because of the way Odoo generates recordsets.
_("You cannot cancel registrations from events of different " | ||
"types at once.")) | ||
res['event_type_id'] = event_type.id | ||
first_type = registrations[0].event_id.type |
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.
Put registrations[:1]
to avoid errors in case of 0 registrations.
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.
Is that even possible?
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.
Not sure, but making your code bullet-proof is always better
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.
Yes, I know, but I feel an exception here would be the right thing to happen. After all, what registrations are you going to cancel if there are none?
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.
Put then self.ensure_one()
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.
No, but that doesn't serve for multi...
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.
I prefer the other formula. It can silently pass to the other window without problems, and it's harmless
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.
I still cannot find a real use case where you could possibly get to this wizard and registrations
would be empty (and less where you'd wish the process not to get interrupted). But nevermind, let me change it.
Please tag as "needs review". |
👍 |
Thanks! 👍 |
👍 |
Make no type count as a type.
Fix #35. When an event had no type, it was not getting in the mapping because of the way Odoo generates recordsets.
@rafaelbn @pedrobaeza