[FIX] website_sale: trigger the change event on the right node

This commit is contained in:
Simon Lejeune 2014-10-17 17:04:09 +02:00
parent ed18ab7649
commit 258a4cac82
1 changed files with 5 additions and 2 deletions

View File

@ -169,12 +169,15 @@ $('.oe_website_sale').each(function () {
$select.find("option:not(:first)").hide();
var nb = $select.find("option[data-country_id="+($(this).val() || 0)+"]").show().size();
$select.parent().toggle(nb>1);
}).change();
});
$(oe_website_sale).find("select[name='country_id']").change();
$(oe_website_sale).on('change', "select[name='shipping_country_id']", function () {
var $select = $("select[name='shipping_state_id']");
$select.find("option:not(:first)").hide();
var nb = $select.find("option[data-country_id="+($(this).val() || 0)+"]").show().size();
$select.parent().toggle(nb>1);
}).change();
});
$(oe_website_sale).find("select[name='shipping_country_id']").change();
});
});