[FIX] web: send correct filter's context when saving filter
Before this commit, the context coming from the action was merged with the context of the search items to generate the context of the filter to save, when the user clicked on "Save current search", whereas it should not. There is an ActionService test attesting it, but it currently uses a ListView, which is still legacy, so the new faulty code wasn't tested. closes odoo/odoo#81049 X-original-commit: 2d76b33142cf2bf451d4730c035af75c3243da6f Signed-off-by: Julien Mougenot (jum) <jum@odoo.com> Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit is contained in:
@@ -407,7 +407,7 @@ export class SearchModel extends EventBus {
|
||||
*/
|
||||
get context() {
|
||||
if (!this._context) {
|
||||
this._context = this._getContext();
|
||||
this._context = makeContext([this._getContext(), this.globalContext]);
|
||||
}
|
||||
return deepCopy(this._context);
|
||||
}
|
||||
@@ -1325,7 +1325,7 @@ export class SearchModel extends EventBus {
|
||||
*/
|
||||
_getContext() {
|
||||
const groups = this._getGroups();
|
||||
const contexts = [this.userService.context, this.globalContext];
|
||||
const contexts = [this.userService.context];
|
||||
for (const group of groups) {
|
||||
for (const activeItem of group.activeItems) {
|
||||
const context = this._getSearchItemContext(activeItem);
|
||||
|
||||
@@ -181,6 +181,7 @@ QUnit.module("Search", (hooks) => {
|
||||
}
|
||||
},
|
||||
resModel: "foo",
|
||||
context: { someOtherKey: "bar" }, // should not end up in filter's context
|
||||
Component: TestComponent,
|
||||
searchViewId: false,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user