Odoo Help


1 Answer
Niraj Pajwani
1/28/19, 8:17 AM
var _onCarrierUpdateAnswer = function(result) {
    var $amount_delivery = $('#order_delivery span.oe_currency_value');
    var $amount_untaxed = $('#order_total_untaxed span.oe_currency_value');
    var $amount_tax = $('#order_total_taxes span.oe_currency_value');
    var $amount_total = $('#order_total span.oe_currency_value');
    var $carrier_badge = $('#delivery_carrier input[name="delivery_type"][value=' + result.carrier_id + '] ~ .badge.hidden');
    var $compute_badge = $('#delivery_carrier input[name="delivery_type"][value=' + result.carrier_id + '] ~ .o_delivery_compute');
    if (result.status === true) {
        // your custom code
        $pay_button.prop('disabled', true);
    else {

var _onCarrierClick = function(ev) {
    $pay_button.prop('disabled', true);
    var carrier_id = $(ev.currentTarget).val();
    var values = {'carrier_id': carrier_id};
    ajax.jsonRpc('/shop/update_carrier', 'call', values)

var $carriers = $("#delivery_carrier input[name='delivery_type']");
1 Comment
Niraj Pajwani
1/28/19, 8:24 AM

We can't directly inherit _onCarrierUpdateAnswer method. We have to bind click even using our custom code and disconnect the current code.

Here the $carriers.off('click'); will disconnect the original base code and $carriers.click(_onCarrierClick); will help us to bind the click event handler and run our custom code with the modification.

Hope this will help you.

Ask a Question
Keep Informed
1 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now