diff options
| author | Romain Derie <rde@odoo.com> | 2017-11-29 12:44:12 +0100 |
|---|---|---|
| committer | Romain Derie <rde@odoo.com> | 2017-11-29 13:31:59 +0100 |
| commit | 82bde85030b58959bba8efddb13746e5dc3e4601 (patch) | |
| tree | f13ed24bf8ffcf2dbc7578637df943cc2f712264 /odoo/modules/loading.py | |
| parent | 832d73deb455f070de455b9f0f9b1c5586ffdb0e (diff) | |
[FIX] website_sale(_options): text in field qty throws error and/or create infinite quotations
Before this commit:
1. If user wrote text in the quantity field to add to his cart, it would crash
and show a server error.
Now, if the user insert a non-valid quantity in the field, we set it to 1
Step to reproduce:
With website_sale only
- Go to a product page on the shop
- Insert 'abc' in the quantity field and click 'Add to Cart'
- Server will throw an error 'Can't parse float..'
With website_sale_options
- Go to a product page on the shop
- Insert 'abc' in the quantity field and click 'Add to Cart'
- Popup confirmation with optional product will show with 'NaN' in the qty
- Click 'Proceed to checkout'
- Server will throw an error 'Can't parse int..'
2. On the checkout, if user typed text in qty field it would create infinite
quotations.
Some modules (eg: website_event_sale) would hide this behavior because they
override the RPC call to '/shop/cart/update_json' and throw an error on the
RPC.
Now, if user type incorrect integer quantity, we set the quantity to 1.
Step to reproduce:
1. On base (website_sale only)
- Add an item to your cart
- On checkout page, set qty to 'abcd' or whatever text
- Check your browser console, every 500ms their will be a RPC call
- Check your quotations in backend, their will be a new one every 500ms
2. On db-all
- Add an item to your cart
- Set qty to 'abcd' or whatever text
- Check your browser console, it will throw an error on the second call
This closes #20482, closes #20904
Diffstat (limited to 'odoo/modules/loading.py')
0 files changed, 0 insertions, 0 deletions
