[FIX] web: FieldDomain: don't open record from selection
The FieldDomain allows to open a list in a dialog to display the records matching the current domain. In this dialog, clicking on a record should do nothing (this was the behavior before the new views). Before this rev., it actually tried to open the record and it produced a crash.
This commit is contained in:
committed by
Aaron Bohy
parent
116aa22685
commit
de48daf53a
@@ -1994,8 +1994,9 @@ var FieldDomain = AbstractField.extend({
|
||||
"click .o_field_domain_dialog_button": "_onDialogEditButtonClick",
|
||||
}),
|
||||
custom_events: _.extend({}, AbstractField.prototype.custom_events, {
|
||||
"domain_changed": "_onDomainSelectorValueChange",
|
||||
"domain_selected": "_onDomainSelectorDialogValueChange",
|
||||
domain_changed: "_onDomainSelectorValueChange",
|
||||
domain_selected: "_onDomainSelectorDialogValueChange",
|
||||
open_record: "_onOpenRecord",
|
||||
}),
|
||||
/**
|
||||
* @constructor
|
||||
@@ -2176,6 +2177,15 @@ var FieldDomain = AbstractField.extend({
|
||||
_onDomainSelectorDialogValueChange: function (e) {
|
||||
this._setValue(Domain.prototype.arrayToString(e.data.domain));
|
||||
},
|
||||
/**
|
||||
* Stops the propagation of the 'open_record' event, as we don't want the
|
||||
* user to be able to open records from the list opened in a dialog.
|
||||
*
|
||||
* @param {OdooEvent} event
|
||||
*/
|
||||
_onOpenRecord: function (event) {
|
||||
event.stopPropagation();
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user