Skip to content

Commit

Permalink
fix: ditch the view get API call in one2many for the moment (#864)
Browse files Browse the repository at this point in the history
  • Loading branch information
mguellsegarra authored Jan 29, 2025
1 parent f89c7b1 commit e89afa4
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/widgets/base/one2many/One2many.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,13 @@ export const One2many = (props: Props) => {
}, [ooui]);

const getViewData = async (type: ViewType) => {
const getViewPromise = ConnectionProvider.getHandler().getView({
model: relation,
type,
context: { ...getContext?.(), ...context },
});

if (oouiViews && oouiViews[type]) {
const view = oouiViews[type];
if (!view.toolbar && (type === "form" || type === "tree")) {
const viewWithToolbar: TreeView | FormView = await getViewPromise;
return { ...view, toolbar: viewWithToolbar.toolbar };
}
// TODO: Replace with the new API call to retrieve only the toolbar
// if (!view.toolbar && (type === "form" || type === "tree")) {
// const viewWithToolbar: TreeView | FormView = await getViewPromise;
// return { ...view, toolbar: viewWithToolbar.toolbar };
// }
return view;
}

Expand Down

0 comments on commit e89afa4

Please sign in to comment.