muk-it / muk_dms

MuK Document Management System
GNU Lesser General Public License v3.0
91 stars 144 forks source link

Error on Search for Odoo v11 Community #111

Open agcopley opened 4 years ago

agcopley commented 4 years ago

Hi there,

Before anything, many thanks for the great work! I bought one of your paid modules to help out. I am getting an error on entering text in the search bar on the documents page..Hope you can help

Andrew

Error: Uncaught TypeError: Cannot read property 'odoo_id' of undefined

http://157.230.169.143:8069/muk_dms/static/src/js/views/documents/dms_documents_base_model.js:298 Rastreo de error: TypeError: Cannot read property 'odoo_id' of undefined at Class._searchNodes (http://157.230.169.143:8069/muk_dms/static/src/js/views/documents/dms_documents_base_model.js:298:85) at Class.search (http://157.230.169.143:8069/muk_dms/static/src/js/views/documents/dms_documents_base_model.js:80:18) at Class._searchData (http://157.230.169.143:8069/muk_dms/static/src/js/views/documents/dms_documents_base_controller.js:256:18) at $.jstree.plugins.contextmenu.search (http://157.230.169.143:8069/muk_web_utils/static/lib/jsTree/jstree.js:7531:15) at Class.search (http://157.230.169.143:8069/muk_dms/static/src/js/views/documents/dms_documents_base_controller.js:118:39) at Class. (http://157.230.169.143:8069/muk_dms/static/src/js/views/documents/dms_documents_base_view.js:114:22) at later (http://157.230.169.143:8069/web/static/lib/underscore/underscore.js:821:25)

agcopley commented 4 years ago

Ok, nothing happening here. Anyone else come across a solution for this?

keshrath commented 4 years ago

@Kerrim- Have you been able to reproduce this error?

jaa-odoo commented 4 years ago

Hello I am getting this same error in odoo 11 community version that issues is fixed in odoo 12 https://github.com/muk-it/muk_dms/blob/11.0/muk_dms/static/src/js/views/documents/dms_documents_base_controller.js#L253-L266 Please change this method like below

  _searchData: function(val, callback) {
        var node = this.getSelectedDirectory();
        if(node) {
            this.model.search(val, node, {
                search: {
                    operator: this.searchTester.test(val) ? "=ilike" : "ilike",
                }
            }).then(function(data) {
                callback.call(this, data);
            });
        } else {
            callback.call(this, []);
        }
    },

and it will woks Thanks