How to use the web.ajax.jsonRpc function in web

To help you get started, we’ve selected a few web examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flectra-hq / flectra / addons / website_mass_mailing / static / src / js / website_mass_mailing.editor.js View on Github external
return this._super(previewMode, value).then(function (mailing_list_id) {
            ajax.jsonRpc('/web/dataset/call', 'call', {
                model: 'mail.mass_mailing.list',
                method: 'read',
                args: [[parseInt(mailing_list_id)], ['popup_content'], weContext.get()],
            }).then(function (data) {
                self.$target.find(".o_popup_content_dev").empty();
                if (data && data[0].popup_content) {
                    $(data[0].popup_content).appendTo(self.$target.find(".o_popup_content_dev"));
                }
            });
        });
    },
github flectra-hq / flectra / addons / website_sale_comparison / static / src / js / website_sale_comparison.js View on Github external
load_products:function(product_ids) {
        var self = this;
        return ajax.jsonRpc('/shop/get_product_data', 'call', {
            'product_ids': product_ids,
            'cookies': JSON.parse(utils.get_cookie('comparelist_product_ids') || '[]'),
        }).then(function (data) {
            self.comparelist_product_ids = JSON.parse(data.cookies);
            delete data.cookies;
            _.each(data, function(product) {
                self.product_data[product.product.id] = product;
            });
        });
    },
    toggle_panel: function() {
github flectra-hq / flectra / addons / website_forum / static / src / js / website_forum.js View on Github external
$('.send_validation_email').on('click', function (ev) {
        ev.preventDefault();
        var $link = $(ev.currentTarget);
        ajax.jsonRpc("/forum/send_validation_email", 'call', {
            'forum_id': $link.attr('forum-id'),
        }).then(function (data) {
            if (data) {
                $('button.validation_email_close').click();
            }
        });
    });

web

A small and fast web/http library for nodejs. (replaces the built-in http module)

MIT
Latest version published 11 years ago

Package Health Score

45 / 100
Full package analysis