How to use the web.DataModel 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 DocMarty84 / koozic / addons / web / static / src / js / views / form_relational_widgets.js View on Github external
query_records: function() {
        var self = this;
        var model = new Model(this.field.relation);
        this.records_orderer.add(model.call("search", [this.get("domain")], {"context": this.build_context()}).then(function(record_ids) {
            return model.call("name_get", [record_ids] , {"context": self.build_context()});
        })).then(function(res) {
            self.set("records", res);
        });
    },
    render_value: function() {
github DocMarty84 / koozic / addons / web / static / src / js / views / form_widgets.js View on Github external
query_values: function() {
        var self = this;
        var def;
        if (this.field.type === "many2one") {
            var model = new Model(this.field.relation);
            def = model.call("name_search", ['', this.get("domain")], {"context": this.build_context()});
        } else {
            var values = _.reject(this.field.selection, function (v) { return v[0] === false && v[1] === ''; });
            def = $.when(values);
        }
        this.records_orderer.add(def).then(function(values) {
            if (! _.isEqual(values, self.get("values"))) {
                self.set("values", values);
            }
        });
    },
    initialize_content: function() {
github AwesomeFoodCoops / odoo-production / odoo / addons / web / static / src / js / views / form_relational_widgets.js View on Github external
query_records: function() {
        var self = this;
        var model = new Model(this.field.relation);
        this.records_orderer.add(model.call("search", [this.get("domain")], {"context": this.build_context()}).then(function(record_ids) {
            return model.call("name_get", [record_ids] , {"context": self.build_context()});
        })).then(function(res) {
            self.set("records", res);
        });
    },
    render_value: function() {
github AwesomeFoodCoops / odoo-production / odoo / addons / web / static / src / js / views / form_widgets.js View on Github external
query_values: function() {
        var self = this;
        var def;
        if (this.field.type === "many2one") {
            var model = new Model(this.field.relation);
            def = model.call("name_search", ['', this.get("domain")], {"context": this.build_context()});
        } else {
            var values = _.reject(this.field.selection, function (v) { return v[0] === false && v[1] === ''; });
            def = $.when(values);
        }
        this.records_orderer.add(def).then(function(values) {
            if (! _.isEqual(values, self.get("values"))) {
                self.set("values", values);
            }
        });
    },
    initialize_content: function() {

web

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

MIT
Latest version published 12 years ago

Package Health Score

45 / 100
Full package analysis