[FIX] website_sale_delivery: avoid selecting unavailable delivery method
authorMartin Trigaux <mat@openerp.com>
Tue, 22 Jul 2014 14:15:01 +0000 (16:15 +0200)
committerMartin Trigaux <mat@openerp.com>
Tue, 22 Jul 2014 15:03:02 +0000 (17:03 +0200)
commit36fcfc66c40a930c8dcc91b3172803b07c6ec195
treec78d3154e87a9d289fc1f3b8c70ec9de3724bf52
parent005282014acfb372f9b5549929931c05021a3bdf
[FIX] website_sale_delivery: avoid selecting unavailable delivery method

If somebody selects a delivery method not matching any criteria, the server would crash (500 for the user). This is due to error raised in get_price_from_picking which is triggered by the function field 'price' on the 'delivery.carrier' object.
To avoid this, add field 'available' on the carrier that will be False when no delivery gird is found or when the error is raised. In this case, the delivery choice is disabled. opw 610210
addons/delivery/delivery.py
addons/website_sale_delivery/views/website_sale_delivery.xml