-
Notifications
You must be signed in to change notification settings - Fork 23.2k
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
[FIX] lunch: prevent indexerror when deleting topping #162207
[FIX] lunch: prevent indexerror when deleting topping #162207
Conversation
bc30322
to
e65a4bd
Compare
Hello @odoo/sentry_reviewers 👋 |
d320ce3
to
5091f14
Compare
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.
LGTM
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.
make the comments above the lines
b54c107
to
03da274
Compare
Done. |
When the user tries to delete the toppings, a traceback appears. Steps to reproduce the error: - Go to Lunch > Configuration > Vendors > Open any vendor - Now add extra 2 (topping 2) > Save - Delete that extra 2 (topping 2) > Save Error: A traceback appears: "IndexError: list index out of range" https://github.com/odoo/odoo/blob/07f6d71e4dd3fac7b4cacc545819430aa48823cd/addons/lunch/models/lunch_supplier.py#L192-L193 Here when the user deletes the extra 2 (topping 2), "topping" will be [2,2] instead of [2,2,False]. So when it tries to access topping[2], It will lead to the above traceback. sentry-5203693767
03da274
to
5d64eab
Compare
Hello @sofiagvaladze 👋 |
robodoo r+ |
When the user tries to delete the toppings, a traceback appears. Steps to reproduce the error: - Go to Lunch > Configuration > Vendors > Open any vendor - Now add extra 2 (topping 2) > Save - Delete that extra 2 (topping 2) > Save Error: A traceback appears: "IndexError: list index out of range" https://github.com/odoo/odoo/blob/07f6d71e4dd3fac7b4cacc545819430aa48823cd/addons/lunch/models/lunch_supplier.py#L192-L193 Here when the user deletes the extra 2 (topping 2), "topping" will be [2,2] instead of [2,2,False]. So when it tries to access topping[2], It will lead to the above traceback. sentry-5203693767 closes odoo#162207 Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
When the user tries to delete the toppings,
a traceback appears.
Steps to reproduce the error:
Traceback:
odoo/addons/lunch/models/lunch_supplier.py
Lines 192 to 193 in 07f6d71
"topping" will be [2,2] instead of [2,2,False].
So when it tries to access topping[2],
It will lead to the above traceback.
sentry-5203693767
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr