33 lines
1.4 KiB
JavaScript
33 lines
1.4 KiB
JavaScript
/** @odoo-module **/
|
|
//
|
|
// import {patch} from "@web/core/utils/patch";
|
|
// import * as backend_utils from "@web/legacy/backend_utils";
|
|
//
|
|
// const originalSearchModelStateToLegacy = backend_utils.searchModelStateToLegacy;
|
|
// const originalGetGlobalState = backend_utils.getGlobalState;
|
|
//
|
|
// patch(backend_utils, "header_search_panel.backend_utils", {
|
|
// searchModelStateToLegacy(state) {
|
|
// // 原始state
|
|
// const originalState = JSON.parse(state);
|
|
// // 获取原始state
|
|
// let legacyState = JSON.parse(originalSearchModelStateToLegacy(state));
|
|
// if (originalState.headerSearchInfo) {
|
|
// legacyState.HeaderSearchInfo = originalState.headerSearchInfo;
|
|
// }
|
|
// return JSON.stringify(legacyState)
|
|
// },
|
|
//
|
|
// getGlobalState(legacyControllerState) {
|
|
// // 原始search model
|
|
// const originalSearchModel = JSON.parse(legacyControllerState.searchModel)
|
|
// let globalState = originalGetGlobalState(legacyControllerState);
|
|
// let searchModel = JSON.parse(globalState?.searchModel || "{}");
|
|
// if (originalSearchModel.HeaderSearchInfo) {
|
|
// searchModel.headerSearchInfo = originalSearchModel.HeaderSearchInfo;
|
|
// globalState.searchModel = JSON.stringify(searchModel)
|
|
// }
|
|
// console.log('headerSearchInfo: getGlobalState')
|
|
// return globalState
|
|
// },
|
|
// })
|