1 openerp.web_tests = function (instance) {
2 instance.web.client_actions.add(
3 'buncha-forms', 'instance.web_tests.BunchaForms');
4 instance.web_tests = {};
5 instance.web_tests.BunchaForms = instance.web.OldWidget.extend({
6 init: function (parent) {
8 this.dataset = new instance.web.DataSetSearch(this, 'test.listview.relations');
9 this.form = new instance.web.FormView(this, this.dataset, false, {
10 action_buttons: false,
13 this.form.registry = instance.web.form.readonly;
16 return '<div class="oe-bunchaforms"></div>';
20 this.dataset.read_slice(),
21 this.form.appendTo(this.$element)).then(this.on_everything_loaded);
23 on_everything_loaded: function (slice) {
24 var records = slice[0].records;
25 if (!records.length) {
26 this.form.on_record_loaded({});
29 this.form.on_record_loaded(records[0]);
30 _(records.slice(1)).each(function (record, index) {
31 this.dataset.index = index+1;
32 this.form.reposition($('<div>').appendTo(this.$element));
33 this.form.on_record_loaded(record);