Files
odoo_source/addons/website_sale_delivery
Nicolas Martinelli 66240a8536 [FIX] website_sale_delivery: disable 'Pay Now' button
- Activate a single shipping provider, e.g. UPS
- Go to the eCommerce, purchase an item
- Enter an incorrect address (e.g. street contains more than 35
  characters, or phone number without anough digits).
- Go to the '/shop/payment' page

Nothing prevents from clicking on the 'Pay Now' button although UPS
returns an error.

The fix 0b412c250a doesn't apply after 5836f1611a
since the event requires the `o_delivery_carrier_select` class.

There are several possible solutions for this issue. The one proposed
has the following advantages:
- no upgrade of the view is required
- no additional RPC is performed

It should be fine since if the default carrier selection is ok, the
delivery method will be checked thanks to:
https://github.com/odoo/odoo/blob/33547b6bc94e1df8a8d9c22dc5894678e51a2df6/addons/website_sale_delivery/views/website_sale_delivery_templates.xml#L32

If the default carrier selection is not ok, the delivery method won't be
checked thanks to:
https://github.com/odoo/odoo/blob/33547b6bc94e1df8a8d9c22dc5894678e51a2df6/addons/website_sale_delivery/controllers/main.py#L77
https://github.com/odoo/odoo/blob/33547b6bc94e1df8a8d9c22dc5894678e51a2df6/addons/delivery/models/sale_order.py#L152

opw-2247557

closes odoo/odoo#51852

X-original-commit: 793fa68b2f79fc7da0b92bde4d74dd03ccd9fe44
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-05-26 08:33:25 +00:00
..
…