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: '