Use right form view in Many2One and WinSearch
The first view which is a tree must be removed from the view ids as mode of the screen is form only. issue6510 review35501002
This commit is contained in:
1 parent
02290bebe6
commit
1f5038dd14
2 files changed
+16
-2
No files matched your search
+6
-1
@@ -1884,11 +1884,16 @@ function eval_pyson(value){
|
||||
get_screen: function() {
|
||||
var domain = this.field().get_domain(this.record());
|
||||
var context = this.field().get_context(this.record());
|
||||
var view_ids = (this.attributes.view_ids || '').split(',');
|
||||
if (!jQuery.isEmptyObject(view_ids)) {
|
||||
// Remove the first tree view as mode is form only
|
||||
view_ids.shift();
|
||||
}
|
||||
return new Sao.Screen(this.get_model(), {
|
||||
'context': context,
|
||||
'domain': domain,
|
||||
'mode': ['form'],
|
||||
'view_ids': (this.attributes.view_ids || '').split(','),
|
||||
'view_ids': view_ids,
|
||||
'views_preload': this.attributes.views,
|
||||
'readonly': this._readonly
|
||||
});
|
||||
|
||||
+10
-1
@@ -470,6 +470,8 @@
|
||||
this.model_name = model;
|
||||
this.domain = kwargs.domain || [];
|
||||
this.context = kwargs.context || {};
|
||||
this.view_ids = kwargs.view_ids;
|
||||
this.views_preload = views_preload;
|
||||
this.sel_multi = kwargs.sel_multi;
|
||||
this.callback = callback;
|
||||
this.title = kwargs.title || '';
|
||||
@@ -540,10 +542,17 @@
|
||||
this.screen.search_filter();
|
||||
return;
|
||||
} else if (response_id == 'RESPONSE_ACCEPT') {
|
||||
var view_ids = jQuery.extend([], this.view_ids);
|
||||
if (!jQuery.isEmptyObject(view_ids)) {
|
||||
// Remove the first tree view as mode is form only
|
||||
view_ids.shift();
|
||||
}
|
||||
var screen = new Sao.Screen(this.model_name, {
|
||||
domain: this.domain,
|
||||
context: this.context,
|
||||
mode: ['form']
|
||||
mode: ['form'],
|
||||
view_ids: view_ids,
|
||||
views_preload: this.views_preload,
|
||||
});
|
||||
|
||||
var callback = function(result) {
|
||||
|
||||
Reference in new issue
Block a user