Replace views string with model description

issue2350
review28371002
This commit is contained in:
Sergi Almacellas Abellana committed 2016-07-05 09:54:16 +02:00
1 parent 1a55a423f7
commit 881eca005a
4 files changed
+41 -27

No files matched your search

+2 -3
View File
@@ -288,8 +288,7 @@
this.set_buttons_sensitive();
this.view_prm = this.screen.switch_view().done(function() {
this.set_name(attributes.name ||
this.screen.current_view.attributes.string);
this.set_name(attributes.name || '');
this.el.append(screen.screen_container.el);
if (attributes.res_id) {
screen.group.load([attributes.res_id]);
@@ -813,7 +812,7 @@
this.view_id = (attributes.view_ids.length > 0 ?
attributes.view_ids[0] : null);
this.context = attributes.context;
this.name = attributes.name;
this.name = attributes.name || '';
this.dialogs = [];
this.board = null;
UIView = new Sao.Model('ir.ui.view');
+25 -12
View File
@@ -1737,7 +1737,8 @@
}
};
win = new Sao.Window.Form(screen, callback.bind(this), {
save_current: true
save_current: true,
title: this.attributes.string
});
return;
}
@@ -1764,7 +1765,8 @@
'').split(','),
views_preload: (this.attributes.views || {}),
new_: this.create_access(),
search_filter: parser.quote(text)
search_filter: parser.quote(text),
title: this.attributes.string
});
return;
}
@@ -1787,7 +1789,8 @@
};
var win = new Sao.Window.Form(screen, callback.bind(this), {
new_: true,
save_current: true
save_current: true,
title: this.attributes.string
});
},
key_press: function(event_) {
@@ -1866,7 +1869,8 @@
views_preload: (this.attributes.views ||
{}),
new_: this.create_access(),
search_filter: parser.quote(text)
search_filter: parser.quote(text),
title: this.attributes.string
});
}
}
@@ -2355,7 +2359,8 @@
'').split(','),
views_preload: this.attributes.views || {},
new_: !this.but_new.prop('disabled'),
search_filter: parser.quote(text)
search_filter: parser.quote(text),
title: this.attributes.string
});
},
remove: function(event_) {
@@ -2393,7 +2398,8 @@
var win = new Sao.Window.Form(this.screen, function() {}, {
new_: true,
many: field_size,
context: context
context: context,
title: this.attributes.string
});
}
},
@@ -2430,7 +2436,9 @@
sel_multi: true,
context: context,
domain: domain,
search_filter: ''
search_filter: '',
title: this.attributes.string
});
};
@@ -2500,7 +2508,8 @@
this.validate().done(function() {
var record = this.screen.current_record;
if (record) {
var win = new Sao.Window.Form(this.screen, function() {});
var win = new Sao.Window.Form(this.screen, function() {},
{title: this.attributes.string});
}
}.bind(this));
},
@@ -2687,7 +2696,8 @@
'').split(','),
views_preload: this.attributes.views || {},
new_: this.attributes.create,
search_filter: parser.quote(value)
search_filter: parser.quote(value),
title: this.attributes.string
});
},
remove: function() {
@@ -2739,7 +2749,8 @@
}
}.bind(this);
screen.switch_view().done(function() {
new Sao.Window.Form(screen, callback);
new Sao.Window.Form(screen, callback,
{title: this.attributes.string});
});
},
new_: function() {
@@ -2768,7 +2779,8 @@
screen.switch_view().done(function() {
new Sao.Window.Form(screen, callback, {
'new_': true,
'save_current': true
'save_current': true,
title: this.attributes.string
});
});
}
@@ -3305,7 +3317,8 @@
context: context,
domain: domain,
new_: false,
search_filter: parser.quote(value)
search_filter: parser.quote(value),
title: this.attributes.string
});
},
add_new_keys: function(ids) {
+12 -10
View File
@@ -45,6 +45,7 @@
this.domain = kwargs.domain || null;
this.context = kwargs.context || null;
this.save_current = kwargs.save_current;
this.title = kwargs.title || '';
this.prev_view = screen.current_view;
this.screen.screen_container.alternate_view = true;
this.info_bar = new Sao.Window.InfoBar();
@@ -215,7 +216,7 @@
switch_prm.done(function() {
dialog.add_title(this.screen.current_view.attributes.string);
dialog.add_title(this.title);
dialog.body.append(this.screen.screen_container.alternate_viewport);
this.el.modal('show');
}.bind(this));
@@ -383,8 +384,7 @@
init: function(record, callback) {
this.resource = record.model.name + ',' + record.id;
this.attachment_callback = callback;
var context = jQuery.extend({}, record.get_context());
context.resource = this.resource;
var title = Sao.i18n.gettext('Attachments (%1)', record.rec_name);
var screen = new Sao.Screen('ir.attachment', {
domain: [['resource', '=', this.resource]],
mode: ['tree', 'form'],
@@ -395,7 +395,7 @@
screen.search_filter();
});
Sao.Window.Attachment._super.init.call(this, screen, this.callback,
{view_type: 'tree'});
{view_type: 'tree', title: title});
},
callback: function(result) {
var prm = jQuery.when();
@@ -416,8 +416,7 @@
init: function(record, callback) {
this.resource = record.model.name + ',' + record.id;
this.note_callback = callback;
var context = record.get_context();
context.resource = this.resource;
var title = Sao.i18n.gettext('Notes (%1)', record.rec_name);
var screen = new Sao.Screen('ir.note', {
domain: [['resource', '=', this.resource]],
mode: ['tree', 'form'],
@@ -428,7 +427,7 @@
screen.search_filter();
});
Sao.Window.Note._super.init.call(this, screen, this.callback,
{view_type: 'tree'});
{view_type: 'tree', title: title});
},
callback: function(result) {
var prm = jQuery.when();
@@ -460,7 +459,9 @@
this.context = kwargs.context || {};
this.sel_multi = kwargs.sel_multi;
this.callback = callback;
var dialog = new Sao.Dialog('Search', '', 'lg');
this.title = kwargs.title || '';
var dialog = new Sao.Dialog(Sao.i18n.gettext(
'Search %1', this.title), '', 'lg');
this.el = dialog.modal;
jQuery('<button/>', {
@@ -547,7 +548,8 @@
};
this.el.modal('hide');
new Sao.Window.Form(screen, callback.bind(this), {
new_: true
new_: true,
title: this.title
});
return;
}
@@ -695,7 +697,7 @@
this.select.append(jQuery('<option/>', {
value: revision.valueOf(),
text: Sao.common.format_datetime(
date_format, time_format, revision) + ' ' + name
date_format, time_format, revision) + ' ' + this.title
}));
}.bind(this));
this.el.modal('show');
+2 -2
View File
@@ -8,7 +8,7 @@
this.widget = jQuery('<div/>', {
'class': 'wizard'
});
this.name = name;
this.name = name || '';
this.action_id = null;
this.id = null;
this.ids = null;
@@ -171,7 +171,7 @@
init: function(name) {
Sao.Wizard.Form._super.init.call(this);
this.tab = null; // Filled by Sao.Tab.Wizard
this.name = name;
this.name = name || '';
this.form = jQuery('<div/>', {
'class': 'wizard-form',