@fctc/interface-logic 2.6.5 → 2.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants.d.mts +2 -1
- package/dist/constants.d.ts +2 -1
- package/dist/constants.js +1 -0
- package/dist/constants.mjs +1 -0
- package/dist/hooks.d.mts +6 -446
- package/dist/hooks.d.ts +6 -446
- package/dist/hooks.js +97 -3
- package/dist/hooks.mjs +97 -4
- package/dist/provider.d.mts +1 -1
- package/dist/provider.d.ts +1 -1
- package/dist/provider.js +112 -6
- package/dist/provider.mjs +113 -7
- package/dist/services.d.mts +6 -0
- package/dist/services.d.ts +6 -0
- package/dist/services.js +75 -1
- package/dist/services.mjs +76 -2
- package/dist/use-delete-entity-BKB1wtUA.d.mts +454 -0
- package/dist/use-delete-entity-DOfVRtZd.d.ts +454 -0
- package/package.json +1 -1
package/dist/hooks.mjs
CHANGED
|
@@ -4787,6 +4787,76 @@ function useViewService() {
|
|
|
4787
4787
|
},
|
|
4788
4788
|
[env]
|
|
4789
4789
|
);
|
|
4790
|
+
const loadDataPosSession = useCallback10(
|
|
4791
|
+
({
|
|
4792
|
+
model,
|
|
4793
|
+
ids,
|
|
4794
|
+
xNode,
|
|
4795
|
+
service
|
|
4796
|
+
}) => {
|
|
4797
|
+
const jsonData = {
|
|
4798
|
+
model,
|
|
4799
|
+
method: "load_data" /* LOAD_DATA */,
|
|
4800
|
+
ids,
|
|
4801
|
+
kwargs: {
|
|
4802
|
+
models_to_load: [
|
|
4803
|
+
"pos.config",
|
|
4804
|
+
"pos.order",
|
|
4805
|
+
"pos.order.line",
|
|
4806
|
+
"pos.pack.operation.lot",
|
|
4807
|
+
"pos.payment",
|
|
4808
|
+
"pos.payment.method",
|
|
4809
|
+
"pos.printer",
|
|
4810
|
+
"pos.category",
|
|
4811
|
+
"pos.bill",
|
|
4812
|
+
"res.company",
|
|
4813
|
+
"account.tax",
|
|
4814
|
+
"account.tax.group",
|
|
4815
|
+
"product.product",
|
|
4816
|
+
"product.attribute",
|
|
4817
|
+
"product.attribute.custom.value",
|
|
4818
|
+
"product.template.attribute.line",
|
|
4819
|
+
"product.template.attribute.value",
|
|
4820
|
+
"product.combo",
|
|
4821
|
+
"product.combo.item",
|
|
4822
|
+
"product.packaging",
|
|
4823
|
+
"res.users",
|
|
4824
|
+
"res.partner",
|
|
4825
|
+
"decimal.precision",
|
|
4826
|
+
"uom.uom",
|
|
4827
|
+
"uom.category",
|
|
4828
|
+
"res.country",
|
|
4829
|
+
"res.country.state",
|
|
4830
|
+
"res.lang",
|
|
4831
|
+
"product.pricelist",
|
|
4832
|
+
"product.pricelist.item",
|
|
4833
|
+
"product.category",
|
|
4834
|
+
"account.cash.rounding",
|
|
4835
|
+
"account.fiscal.position",
|
|
4836
|
+
"account.fiscal.position.tax",
|
|
4837
|
+
"stock.picking.type",
|
|
4838
|
+
"res.currency",
|
|
4839
|
+
"pos.note",
|
|
4840
|
+
"ir.ui.view",
|
|
4841
|
+
"product.tag",
|
|
4842
|
+
"ir.module.module"
|
|
4843
|
+
]
|
|
4844
|
+
}
|
|
4845
|
+
};
|
|
4846
|
+
return env?.requests.post(
|
|
4847
|
+
"/call" /* CALL_PATH */,
|
|
4848
|
+
jsonData,
|
|
4849
|
+
{
|
|
4850
|
+
headers: {
|
|
4851
|
+
"Content-Type": "application/json",
|
|
4852
|
+
...xNode ? { "X-Node": xNode } : {}
|
|
4853
|
+
}
|
|
4854
|
+
},
|
|
4855
|
+
service
|
|
4856
|
+
);
|
|
4857
|
+
},
|
|
4858
|
+
[env]
|
|
4859
|
+
);
|
|
4790
4860
|
return {
|
|
4791
4861
|
getView,
|
|
4792
4862
|
getMenu,
|
|
@@ -4812,7 +4882,8 @@ function useViewService() {
|
|
|
4812
4882
|
createEntity,
|
|
4813
4883
|
getList,
|
|
4814
4884
|
updateEntity,
|
|
4815
|
-
deleteEntity
|
|
4885
|
+
deleteEntity,
|
|
4886
|
+
loadDataPosSession
|
|
4816
4887
|
};
|
|
4817
4888
|
}
|
|
4818
4889
|
|
|
@@ -5756,7 +5827,7 @@ var useGetGroups = ({
|
|
|
5756
5827
|
var use_get_groups_default = useGetGroups;
|
|
5757
5828
|
|
|
5758
5829
|
// src/hooks/view/use-get-list-data.ts
|
|
5759
|
-
import {
|
|
5830
|
+
import { useQuery as useQuery14 } from "@tanstack/react-query";
|
|
5760
5831
|
var useGetListData = (listDataProps, queryKey, enabled, service, xNode) => {
|
|
5761
5832
|
const { getAll } = useModelService();
|
|
5762
5833
|
return useQuery14({
|
|
@@ -5769,8 +5840,7 @@ var useGetListData = (listDataProps, queryKey, enabled, service, xNode) => {
|
|
|
5769
5840
|
}),
|
|
5770
5841
|
enabled,
|
|
5771
5842
|
refetchOnWindowFocus: false,
|
|
5772
|
-
staleTime: 0
|
|
5773
|
-
placeholderData: keepPreviousData
|
|
5843
|
+
staleTime: 0
|
|
5774
5844
|
});
|
|
5775
5845
|
};
|
|
5776
5846
|
var use_get_list_data_default = useGetListData;
|
|
@@ -6375,6 +6445,28 @@ var useDeleteEntity = () => {
|
|
|
6375
6445
|
});
|
|
6376
6446
|
};
|
|
6377
6447
|
var use_delete_entity_default = useDeleteEntity;
|
|
6448
|
+
|
|
6449
|
+
// src/hooks/view/use-load-data-pos-session.ts
|
|
6450
|
+
import { useMutation as useMutation58 } from "@tanstack/react-query";
|
|
6451
|
+
var useLoadDataPosSession = () => {
|
|
6452
|
+
const { loadDataPosSession } = useViewService();
|
|
6453
|
+
return useMutation58({
|
|
6454
|
+
mutationFn: ({
|
|
6455
|
+
model,
|
|
6456
|
+
ids,
|
|
6457
|
+
xNode,
|
|
6458
|
+
service
|
|
6459
|
+
}) => {
|
|
6460
|
+
return loadDataPosSession({
|
|
6461
|
+
model,
|
|
6462
|
+
ids,
|
|
6463
|
+
xNode,
|
|
6464
|
+
service
|
|
6465
|
+
});
|
|
6466
|
+
}
|
|
6467
|
+
});
|
|
6468
|
+
};
|
|
6469
|
+
var use_load_data_pos_session_default = useLoadDataPosSession;
|
|
6378
6470
|
export {
|
|
6379
6471
|
use_button_default as useButton,
|
|
6380
6472
|
use_change_status_default as useChangeStatus,
|
|
@@ -6424,6 +6516,7 @@ export {
|
|
|
6424
6516
|
use_handle_closing_session_default as useHandleClosingSession,
|
|
6425
6517
|
use_isvalid_token_default as useIsValidToken,
|
|
6426
6518
|
use_load_action_default as useLoadAction,
|
|
6519
|
+
use_load_data_pos_session_default as useLoadDataPosSession,
|
|
6427
6520
|
use_load_message_default as useLoadMessage,
|
|
6428
6521
|
use_login_credential_default as useLoginCredential,
|
|
6429
6522
|
use_login_socical_default as useLoginSocial,
|
package/dist/provider.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { L as LocalStorageUtilsType, S as SessionStorageUtilsType } from './session-storage-ARp_lhTD.mjs';
|
|
4
|
-
import { useForgotPassword, useForgotPasswordSSO, useGetProvider, useIsValidToken, useLoginCredential, useLoginSocial, useResetPassword, useResetPasswordSSO, useUpdatePassword, useLogout, useGetAccessByCode, useValidateActionToken, useGetCompanyInfo, useGetCurrentCompany, useGetListCompany, useExecuteImport, useExportExcel, useGetFieldExport, useGetFileExcel, useParsePreview, useUploadFileExcel, useUploadIdFile, useChangeStatus, useDeleteComment, useGetComment, useGetFormView, useGetImage, useSendComment, useUploadImage, useDelete, useGetAll, useGetConversionRate, useGetCurrency, useGetDetail, useGetFieldOnChange, useGetListMyBankAccount, useModel, useOdooDataTransform, useOnChangeForm, useSave, useGetProfile, useGetUser, useSwitchLocale, useButton, useDuplicateRecord, useGet2FAMethods, useGetActionDetail, useGetCalendar, useGetGroups, useGetListData, useGetMenu, useGetPrintReport, useGetProGressBar, useGetResequence, useGetSelection, useGetView, useLoadAction, useLoadMessage, usePrint, useRemoveRow, useRunAction, useSignInSSO, useVerify2FA, useGrantAccess, useRemoveTotpSetup, useRequestSetupTotp, useSettingsWebRead2fa, useVerifyTotp, useUploadFile, useCreateEntity, useGetASession, useCreateSession, useDeleteEntity, useGetList, useGetPos, useHandleClosingSession, useManageSession, useUpdateClosedSession, useUpdateEntity } from './
|
|
4
|
+
import { g as useForgotPassword, h as useForgotPasswordSSO, G as useGetProvider, L as useIsValidToken, O as useLoginCredential, P as useLoginSocial, W as useResetPassword, X as useResetPasswordSSO, a1 as useUpdatePassword, a7 as useLogout, a6 as useGetAccessByCode, ad as useValidateActionToken, n as useGetCompanyInfo, q as useGetCurrentCompany, z as useGetListCompany, e as useExecuteImport, f as useExportExcel, s as useGetFieldExport, v as useGetFileExcel, T as useParsePreview, a2 as useUploadFileExcel, a3 as useUploadIdFile, a as useChangeStatus, c as useDeleteComment, m as useGetComment, w as useGetFormView, y as useGetImage, _ as useSendComment, a4 as useUploadImage, b as useDelete, k as useGetAll, o as useGetConversionRate, p as useGetCurrency, r as useGetDetail, t as useGetFieldOnChange, B as useGetListMyBankAccount, Q as useModel, R as useOdooDataTransform, S as useOnChangeForm, Z as useSave, E as useGetProfile, J as useGetUser, a0 as useSwitchLocale, u as useButton, d as useDuplicateRecord, i as useGet2FAMethods, j as useGetActionDetail, l as useGetCalendar, x as useGetGroups, A as useGetListData, C as useGetMenu, D as useGetPrintReport, F as useGetProGressBar, H as useGetResequence, I as useGetSelection, K as useGetView, M as useLoadAction, N as useLoadMessage, U as usePrint, V as useRemoveRow, Y as useRunAction, $ as useSignInSSO, a5 as useVerify2FA, a8 as useGrantAccess, a9 as useRemoveTotpSetup, aa as useRequestSetupTotp, ab as useSettingsWebRead2fa, ac as useVerifyTotp, ae as useUploadFile, al as useCreateEntity, af as useGetASession, aj as useCreateSession, ao as useDeleteEntity, am as useGetList, ak as useGetPos, ai as useHandleClosingSession, ah as useManageSession, ag as useUpdateClosedSession, an as useUpdateEntity } from './use-delete-entity-BKB1wtUA.mjs';
|
|
5
5
|
import '@tanstack/react-query';
|
|
6
6
|
import './view-type-xxw9OeSR.mjs';
|
|
7
7
|
import './base-model-type-DD8uZnDP.mjs';
|
package/dist/provider.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { L as LocalStorageUtilsType, S as SessionStorageUtilsType } from './session-storage-ARp_lhTD.js';
|
|
4
|
-
import { useForgotPassword, useForgotPasswordSSO, useGetProvider, useIsValidToken, useLoginCredential, useLoginSocial, useResetPassword, useResetPasswordSSO, useUpdatePassword, useLogout, useGetAccessByCode, useValidateActionToken, useGetCompanyInfo, useGetCurrentCompany, useGetListCompany, useExecuteImport, useExportExcel, useGetFieldExport, useGetFileExcel, useParsePreview, useUploadFileExcel, useUploadIdFile, useChangeStatus, useDeleteComment, useGetComment, useGetFormView, useGetImage, useSendComment, useUploadImage, useDelete, useGetAll, useGetConversionRate, useGetCurrency, useGetDetail, useGetFieldOnChange, useGetListMyBankAccount, useModel, useOdooDataTransform, useOnChangeForm, useSave, useGetProfile, useGetUser, useSwitchLocale, useButton, useDuplicateRecord, useGet2FAMethods, useGetActionDetail, useGetCalendar, useGetGroups, useGetListData, useGetMenu, useGetPrintReport, useGetProGressBar, useGetResequence, useGetSelection, useGetView, useLoadAction, useLoadMessage, usePrint, useRemoveRow, useRunAction, useSignInSSO, useVerify2FA, useGrantAccess, useRemoveTotpSetup, useRequestSetupTotp, useSettingsWebRead2fa, useVerifyTotp, useUploadFile, useCreateEntity, useGetASession, useCreateSession, useDeleteEntity, useGetList, useGetPos, useHandleClosingSession, useManageSession, useUpdateClosedSession, useUpdateEntity } from './
|
|
4
|
+
import { g as useForgotPassword, h as useForgotPasswordSSO, G as useGetProvider, L as useIsValidToken, O as useLoginCredential, P as useLoginSocial, W as useResetPassword, X as useResetPasswordSSO, a1 as useUpdatePassword, a7 as useLogout, a6 as useGetAccessByCode, ad as useValidateActionToken, n as useGetCompanyInfo, q as useGetCurrentCompany, z as useGetListCompany, e as useExecuteImport, f as useExportExcel, s as useGetFieldExport, v as useGetFileExcel, T as useParsePreview, a2 as useUploadFileExcel, a3 as useUploadIdFile, a as useChangeStatus, c as useDeleteComment, m as useGetComment, w as useGetFormView, y as useGetImage, _ as useSendComment, a4 as useUploadImage, b as useDelete, k as useGetAll, o as useGetConversionRate, p as useGetCurrency, r as useGetDetail, t as useGetFieldOnChange, B as useGetListMyBankAccount, Q as useModel, R as useOdooDataTransform, S as useOnChangeForm, Z as useSave, E as useGetProfile, J as useGetUser, a0 as useSwitchLocale, u as useButton, d as useDuplicateRecord, i as useGet2FAMethods, j as useGetActionDetail, l as useGetCalendar, x as useGetGroups, A as useGetListData, C as useGetMenu, D as useGetPrintReport, F as useGetProGressBar, H as useGetResequence, I as useGetSelection, K as useGetView, M as useLoadAction, N as useLoadMessage, U as usePrint, V as useRemoveRow, Y as useRunAction, $ as useSignInSSO, a5 as useVerify2FA, a8 as useGrantAccess, a9 as useRemoveTotpSetup, aa as useRequestSetupTotp, ab as useSettingsWebRead2fa, ac as useVerifyTotp, ae as useUploadFile, al as useCreateEntity, af as useGetASession, aj as useCreateSession, ao as useDeleteEntity, am as useGetList, ak as useGetPos, ai as useHandleClosingSession, ah as useManageSession, ag as useUpdateClosedSession, an as useUpdateEntity } from './use-delete-entity-DOfVRtZd.js';
|
|
5
5
|
import '@tanstack/react-query';
|
|
6
6
|
import './view-type-xxw9OeSR.js';
|
|
7
7
|
import './base-model-type-DD8uZnDP.js';
|
package/dist/provider.js
CHANGED
|
@@ -4839,6 +4839,76 @@ function useViewService() {
|
|
|
4839
4839
|
},
|
|
4840
4840
|
[env]
|
|
4841
4841
|
);
|
|
4842
|
+
const loadDataPosSession = (0, import_react10.useCallback)(
|
|
4843
|
+
({
|
|
4844
|
+
model,
|
|
4845
|
+
ids,
|
|
4846
|
+
xNode,
|
|
4847
|
+
service
|
|
4848
|
+
}) => {
|
|
4849
|
+
const jsonData = {
|
|
4850
|
+
model,
|
|
4851
|
+
method: "load_data" /* LOAD_DATA */,
|
|
4852
|
+
ids,
|
|
4853
|
+
kwargs: {
|
|
4854
|
+
models_to_load: [
|
|
4855
|
+
"pos.config",
|
|
4856
|
+
"pos.order",
|
|
4857
|
+
"pos.order.line",
|
|
4858
|
+
"pos.pack.operation.lot",
|
|
4859
|
+
"pos.payment",
|
|
4860
|
+
"pos.payment.method",
|
|
4861
|
+
"pos.printer",
|
|
4862
|
+
"pos.category",
|
|
4863
|
+
"pos.bill",
|
|
4864
|
+
"res.company",
|
|
4865
|
+
"account.tax",
|
|
4866
|
+
"account.tax.group",
|
|
4867
|
+
"product.product",
|
|
4868
|
+
"product.attribute",
|
|
4869
|
+
"product.attribute.custom.value",
|
|
4870
|
+
"product.template.attribute.line",
|
|
4871
|
+
"product.template.attribute.value",
|
|
4872
|
+
"product.combo",
|
|
4873
|
+
"product.combo.item",
|
|
4874
|
+
"product.packaging",
|
|
4875
|
+
"res.users",
|
|
4876
|
+
"res.partner",
|
|
4877
|
+
"decimal.precision",
|
|
4878
|
+
"uom.uom",
|
|
4879
|
+
"uom.category",
|
|
4880
|
+
"res.country",
|
|
4881
|
+
"res.country.state",
|
|
4882
|
+
"res.lang",
|
|
4883
|
+
"product.pricelist",
|
|
4884
|
+
"product.pricelist.item",
|
|
4885
|
+
"product.category",
|
|
4886
|
+
"account.cash.rounding",
|
|
4887
|
+
"account.fiscal.position",
|
|
4888
|
+
"account.fiscal.position.tax",
|
|
4889
|
+
"stock.picking.type",
|
|
4890
|
+
"res.currency",
|
|
4891
|
+
"pos.note",
|
|
4892
|
+
"ir.ui.view",
|
|
4893
|
+
"product.tag",
|
|
4894
|
+
"ir.module.module"
|
|
4895
|
+
]
|
|
4896
|
+
}
|
|
4897
|
+
};
|
|
4898
|
+
return env?.requests.post(
|
|
4899
|
+
"/call" /* CALL_PATH */,
|
|
4900
|
+
jsonData,
|
|
4901
|
+
{
|
|
4902
|
+
headers: {
|
|
4903
|
+
"Content-Type": "application/json",
|
|
4904
|
+
...xNode ? { "X-Node": xNode } : {}
|
|
4905
|
+
}
|
|
4906
|
+
},
|
|
4907
|
+
service
|
|
4908
|
+
);
|
|
4909
|
+
},
|
|
4910
|
+
[env]
|
|
4911
|
+
);
|
|
4842
4912
|
return {
|
|
4843
4913
|
getView,
|
|
4844
4914
|
getMenu,
|
|
@@ -4864,7 +4934,8 @@ function useViewService() {
|
|
|
4864
4934
|
createEntity,
|
|
4865
4935
|
getList,
|
|
4866
4936
|
updateEntity,
|
|
4867
|
-
deleteEntity
|
|
4937
|
+
deleteEntity,
|
|
4938
|
+
loadDataPosSession
|
|
4868
4939
|
};
|
|
4869
4940
|
}
|
|
4870
4941
|
|
|
@@ -6239,8 +6310,7 @@ var useGetListData = (listDataProps, queryKey, enabled, service, xNode) => {
|
|
|
6239
6310
|
}),
|
|
6240
6311
|
enabled,
|
|
6241
6312
|
refetchOnWindowFocus: false,
|
|
6242
|
-
staleTime: 0
|
|
6243
|
-
placeholderData: import_react_query50.keepPreviousData
|
|
6313
|
+
staleTime: 0
|
|
6244
6314
|
});
|
|
6245
6315
|
};
|
|
6246
6316
|
var use_get_list_data_default = useGetListData;
|
|
@@ -6846,6 +6916,9 @@ var useDeleteEntity = () => {
|
|
|
6846
6916
|
};
|
|
6847
6917
|
var use_delete_entity_default = useDeleteEntity;
|
|
6848
6918
|
|
|
6919
|
+
// src/hooks/view/use-load-data-pos-session.ts
|
|
6920
|
+
var import_react_query80 = require("@tanstack/react-query");
|
|
6921
|
+
|
|
6849
6922
|
// src/provider/service-provider.tsx
|
|
6850
6923
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
6851
6924
|
var ServiceContext = (0, import_react13.createContext)(null);
|
|
@@ -6951,18 +7024,51 @@ var MetaProvider = ({ children }) => {
|
|
|
6951
7024
|
function updateMetadata() {
|
|
6952
7025
|
const metadata = env?.defaultCompany;
|
|
6953
7026
|
if (!metadata) return;
|
|
7027
|
+
if (metadata.display_name) {
|
|
7028
|
+
document.title = metadata.display_name;
|
|
7029
|
+
}
|
|
6954
7030
|
document.documentElement.style.setProperty(
|
|
6955
7031
|
"--primary",
|
|
6956
|
-
metadata
|
|
7032
|
+
metadata?.primary_color
|
|
6957
7033
|
);
|
|
6958
7034
|
document.documentElement.style.setProperty(
|
|
6959
7035
|
"--secondary",
|
|
6960
|
-
metadata
|
|
7036
|
+
metadata?.secondary_color
|
|
6961
7037
|
);
|
|
7038
|
+
const metaDescription = document.querySelector('meta[name="description"]');
|
|
7039
|
+
if (metaDescription) {
|
|
7040
|
+
metaDescription.setAttribute("content", metadata.display_name);
|
|
7041
|
+
} else {
|
|
7042
|
+
const newMetaDescription = document.createElement("meta");
|
|
7043
|
+
newMetaDescription.name = "description";
|
|
7044
|
+
newMetaDescription.content = metadata.display_name;
|
|
7045
|
+
document.head.appendChild(newMetaDescription);
|
|
7046
|
+
}
|
|
7047
|
+
const updateIcon = (rel, href) => {
|
|
7048
|
+
let linkIcon = document.querySelector(
|
|
7049
|
+
`link[rel="${rel}"]`
|
|
7050
|
+
);
|
|
7051
|
+
if (linkIcon) {
|
|
7052
|
+
linkIcon.href = href;
|
|
7053
|
+
} else {
|
|
7054
|
+
linkIcon = document.createElement("link");
|
|
7055
|
+
linkIcon.rel = rel;
|
|
7056
|
+
linkIcon.href = href;
|
|
7057
|
+
document.head.appendChild(linkIcon);
|
|
7058
|
+
}
|
|
7059
|
+
};
|
|
7060
|
+
if (metadata.logo) {
|
|
7061
|
+
updateIcon("icon", metadata.logo);
|
|
7062
|
+
updateIcon("apple-touch-icon", metadata.logo);
|
|
7063
|
+
const faviconLink = document.querySelector('link[href="favicon.ico"]');
|
|
7064
|
+
if (faviconLink) {
|
|
7065
|
+
faviconLink.remove();
|
|
7066
|
+
}
|
|
7067
|
+
}
|
|
6962
7068
|
}
|
|
6963
7069
|
(0, import_react14.useEffect)(() => {
|
|
6964
7070
|
updateMetadata();
|
|
6965
|
-
}, [env]);
|
|
7071
|
+
}, [env?.defaultCompany]);
|
|
6966
7072
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children });
|
|
6967
7073
|
};
|
|
6968
7074
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/provider.mjs
CHANGED
|
@@ -4796,6 +4796,76 @@ function useViewService() {
|
|
|
4796
4796
|
},
|
|
4797
4797
|
[env]
|
|
4798
4798
|
);
|
|
4799
|
+
const loadDataPosSession = useCallback9(
|
|
4800
|
+
({
|
|
4801
|
+
model,
|
|
4802
|
+
ids,
|
|
4803
|
+
xNode,
|
|
4804
|
+
service
|
|
4805
|
+
}) => {
|
|
4806
|
+
const jsonData = {
|
|
4807
|
+
model,
|
|
4808
|
+
method: "load_data" /* LOAD_DATA */,
|
|
4809
|
+
ids,
|
|
4810
|
+
kwargs: {
|
|
4811
|
+
models_to_load: [
|
|
4812
|
+
"pos.config",
|
|
4813
|
+
"pos.order",
|
|
4814
|
+
"pos.order.line",
|
|
4815
|
+
"pos.pack.operation.lot",
|
|
4816
|
+
"pos.payment",
|
|
4817
|
+
"pos.payment.method",
|
|
4818
|
+
"pos.printer",
|
|
4819
|
+
"pos.category",
|
|
4820
|
+
"pos.bill",
|
|
4821
|
+
"res.company",
|
|
4822
|
+
"account.tax",
|
|
4823
|
+
"account.tax.group",
|
|
4824
|
+
"product.product",
|
|
4825
|
+
"product.attribute",
|
|
4826
|
+
"product.attribute.custom.value",
|
|
4827
|
+
"product.template.attribute.line",
|
|
4828
|
+
"product.template.attribute.value",
|
|
4829
|
+
"product.combo",
|
|
4830
|
+
"product.combo.item",
|
|
4831
|
+
"product.packaging",
|
|
4832
|
+
"res.users",
|
|
4833
|
+
"res.partner",
|
|
4834
|
+
"decimal.precision",
|
|
4835
|
+
"uom.uom",
|
|
4836
|
+
"uom.category",
|
|
4837
|
+
"res.country",
|
|
4838
|
+
"res.country.state",
|
|
4839
|
+
"res.lang",
|
|
4840
|
+
"product.pricelist",
|
|
4841
|
+
"product.pricelist.item",
|
|
4842
|
+
"product.category",
|
|
4843
|
+
"account.cash.rounding",
|
|
4844
|
+
"account.fiscal.position",
|
|
4845
|
+
"account.fiscal.position.tax",
|
|
4846
|
+
"stock.picking.type",
|
|
4847
|
+
"res.currency",
|
|
4848
|
+
"pos.note",
|
|
4849
|
+
"ir.ui.view",
|
|
4850
|
+
"product.tag",
|
|
4851
|
+
"ir.module.module"
|
|
4852
|
+
]
|
|
4853
|
+
}
|
|
4854
|
+
};
|
|
4855
|
+
return env?.requests.post(
|
|
4856
|
+
"/call" /* CALL_PATH */,
|
|
4857
|
+
jsonData,
|
|
4858
|
+
{
|
|
4859
|
+
headers: {
|
|
4860
|
+
"Content-Type": "application/json",
|
|
4861
|
+
...xNode ? { "X-Node": xNode } : {}
|
|
4862
|
+
}
|
|
4863
|
+
},
|
|
4864
|
+
service
|
|
4865
|
+
);
|
|
4866
|
+
},
|
|
4867
|
+
[env]
|
|
4868
|
+
);
|
|
4799
4869
|
return {
|
|
4800
4870
|
getView,
|
|
4801
4871
|
getMenu,
|
|
@@ -4821,7 +4891,8 @@ function useViewService() {
|
|
|
4821
4891
|
createEntity,
|
|
4822
4892
|
getList,
|
|
4823
4893
|
updateEntity,
|
|
4824
|
-
deleteEntity
|
|
4894
|
+
deleteEntity,
|
|
4895
|
+
loadDataPosSession
|
|
4825
4896
|
};
|
|
4826
4897
|
}
|
|
4827
4898
|
|
|
@@ -6183,7 +6254,7 @@ var useGetGroups = ({
|
|
|
6183
6254
|
var use_get_groups_default = useGetGroups;
|
|
6184
6255
|
|
|
6185
6256
|
// src/hooks/view/use-get-list-data.ts
|
|
6186
|
-
import {
|
|
6257
|
+
import { useQuery as useQuery14 } from "@tanstack/react-query";
|
|
6187
6258
|
var useGetListData = (listDataProps, queryKey, enabled, service, xNode) => {
|
|
6188
6259
|
const { getAll } = useModelService();
|
|
6189
6260
|
return useQuery14({
|
|
@@ -6196,8 +6267,7 @@ var useGetListData = (listDataProps, queryKey, enabled, service, xNode) => {
|
|
|
6196
6267
|
}),
|
|
6197
6268
|
enabled,
|
|
6198
6269
|
refetchOnWindowFocus: false,
|
|
6199
|
-
staleTime: 0
|
|
6200
|
-
placeholderData: keepPreviousData
|
|
6270
|
+
staleTime: 0
|
|
6201
6271
|
});
|
|
6202
6272
|
};
|
|
6203
6273
|
var use_get_list_data_default = useGetListData;
|
|
@@ -6803,6 +6873,9 @@ var useDeleteEntity = () => {
|
|
|
6803
6873
|
};
|
|
6804
6874
|
var use_delete_entity_default = useDeleteEntity;
|
|
6805
6875
|
|
|
6876
|
+
// src/hooks/view/use-load-data-pos-session.ts
|
|
6877
|
+
import { useMutation as useMutation58 } from "@tanstack/react-query";
|
|
6878
|
+
|
|
6806
6879
|
// src/provider/service-provider.tsx
|
|
6807
6880
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
6808
6881
|
var ServiceContext = createContext2(null);
|
|
@@ -6908,18 +6981,51 @@ var MetaProvider = ({ children }) => {
|
|
|
6908
6981
|
function updateMetadata() {
|
|
6909
6982
|
const metadata = env?.defaultCompany;
|
|
6910
6983
|
if (!metadata) return;
|
|
6984
|
+
if (metadata.display_name) {
|
|
6985
|
+
document.title = metadata.display_name;
|
|
6986
|
+
}
|
|
6911
6987
|
document.documentElement.style.setProperty(
|
|
6912
6988
|
"--primary",
|
|
6913
|
-
metadata
|
|
6989
|
+
metadata?.primary_color
|
|
6914
6990
|
);
|
|
6915
6991
|
document.documentElement.style.setProperty(
|
|
6916
6992
|
"--secondary",
|
|
6917
|
-
metadata
|
|
6993
|
+
metadata?.secondary_color
|
|
6918
6994
|
);
|
|
6995
|
+
const metaDescription = document.querySelector('meta[name="description"]');
|
|
6996
|
+
if (metaDescription) {
|
|
6997
|
+
metaDescription.setAttribute("content", metadata.display_name);
|
|
6998
|
+
} else {
|
|
6999
|
+
const newMetaDescription = document.createElement("meta");
|
|
7000
|
+
newMetaDescription.name = "description";
|
|
7001
|
+
newMetaDescription.content = metadata.display_name;
|
|
7002
|
+
document.head.appendChild(newMetaDescription);
|
|
7003
|
+
}
|
|
7004
|
+
const updateIcon = (rel, href) => {
|
|
7005
|
+
let linkIcon = document.querySelector(
|
|
7006
|
+
`link[rel="${rel}"]`
|
|
7007
|
+
);
|
|
7008
|
+
if (linkIcon) {
|
|
7009
|
+
linkIcon.href = href;
|
|
7010
|
+
} else {
|
|
7011
|
+
linkIcon = document.createElement("link");
|
|
7012
|
+
linkIcon.rel = rel;
|
|
7013
|
+
linkIcon.href = href;
|
|
7014
|
+
document.head.appendChild(linkIcon);
|
|
7015
|
+
}
|
|
7016
|
+
};
|
|
7017
|
+
if (metadata.logo) {
|
|
7018
|
+
updateIcon("icon", metadata.logo);
|
|
7019
|
+
updateIcon("apple-touch-icon", metadata.logo);
|
|
7020
|
+
const faviconLink = document.querySelector('link[href="favicon.ico"]');
|
|
7021
|
+
if (faviconLink) {
|
|
7022
|
+
faviconLink.remove();
|
|
7023
|
+
}
|
|
7024
|
+
}
|
|
6919
7025
|
}
|
|
6920
7026
|
useEffect3(() => {
|
|
6921
7027
|
updateMetadata();
|
|
6922
|
-
}, [env]);
|
|
7028
|
+
}, [env?.defaultCompany]);
|
|
6923
7029
|
return /* @__PURE__ */ jsx7(Fragment2, { children });
|
|
6924
7030
|
};
|
|
6925
7031
|
export {
|
package/dist/services.d.mts
CHANGED
|
@@ -342,6 +342,12 @@ declare function useViewService(): {
|
|
|
342
342
|
service: string;
|
|
343
343
|
xNode: string;
|
|
344
344
|
}) => any;
|
|
345
|
+
loadDataPosSession: ({ model, ids, xNode, service, }: {
|
|
346
|
+
model: string;
|
|
347
|
+
ids: any;
|
|
348
|
+
service: string;
|
|
349
|
+
xNode: string;
|
|
350
|
+
}) => any;
|
|
345
351
|
};
|
|
346
352
|
|
|
347
353
|
export { useActionService, useAuthService, useCompanyService, useExcelService, useFormService, useKanbanService, useModelService, useUserService, useViewService };
|
package/dist/services.d.ts
CHANGED
|
@@ -342,6 +342,12 @@ declare function useViewService(): {
|
|
|
342
342
|
service: string;
|
|
343
343
|
xNode: string;
|
|
344
344
|
}) => any;
|
|
345
|
+
loadDataPosSession: ({ model, ids, xNode, service, }: {
|
|
346
|
+
model: string;
|
|
347
|
+
ids: any;
|
|
348
|
+
service: string;
|
|
349
|
+
xNode: string;
|
|
350
|
+
}) => any;
|
|
345
351
|
};
|
|
346
352
|
|
|
347
353
|
export { useActionService, useAuthService, useCompanyService, useExcelService, useFormService, useKanbanService, useModelService, useUserService, useViewService };
|
package/dist/services.js
CHANGED
|
@@ -3080,6 +3080,9 @@ var import_react_query78 = require("@tanstack/react-query");
|
|
|
3080
3080
|
// src/hooks/view/use-delete-entity.ts
|
|
3081
3081
|
var import_react_query79 = require("@tanstack/react-query");
|
|
3082
3082
|
|
|
3083
|
+
// src/hooks/view/use-load-data-pos-session.ts
|
|
3084
|
+
var import_react_query80 = require("@tanstack/react-query");
|
|
3085
|
+
|
|
3083
3086
|
// src/provider/service-provider.tsx
|
|
3084
3087
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
3085
3088
|
var ServiceContext = (0, import_react4.createContext)(null);
|
|
@@ -5039,6 +5042,76 @@ function useViewService() {
|
|
|
5039
5042
|
},
|
|
5040
5043
|
[env]
|
|
5041
5044
|
);
|
|
5045
|
+
const loadDataPosSession = (0, import_react14.useCallback)(
|
|
5046
|
+
({
|
|
5047
|
+
model,
|
|
5048
|
+
ids,
|
|
5049
|
+
xNode,
|
|
5050
|
+
service
|
|
5051
|
+
}) => {
|
|
5052
|
+
const jsonData = {
|
|
5053
|
+
model,
|
|
5054
|
+
method: "load_data" /* LOAD_DATA */,
|
|
5055
|
+
ids,
|
|
5056
|
+
kwargs: {
|
|
5057
|
+
models_to_load: [
|
|
5058
|
+
"pos.config",
|
|
5059
|
+
"pos.order",
|
|
5060
|
+
"pos.order.line",
|
|
5061
|
+
"pos.pack.operation.lot",
|
|
5062
|
+
"pos.payment",
|
|
5063
|
+
"pos.payment.method",
|
|
5064
|
+
"pos.printer",
|
|
5065
|
+
"pos.category",
|
|
5066
|
+
"pos.bill",
|
|
5067
|
+
"res.company",
|
|
5068
|
+
"account.tax",
|
|
5069
|
+
"account.tax.group",
|
|
5070
|
+
"product.product",
|
|
5071
|
+
"product.attribute",
|
|
5072
|
+
"product.attribute.custom.value",
|
|
5073
|
+
"product.template.attribute.line",
|
|
5074
|
+
"product.template.attribute.value",
|
|
5075
|
+
"product.combo",
|
|
5076
|
+
"product.combo.item",
|
|
5077
|
+
"product.packaging",
|
|
5078
|
+
"res.users",
|
|
5079
|
+
"res.partner",
|
|
5080
|
+
"decimal.precision",
|
|
5081
|
+
"uom.uom",
|
|
5082
|
+
"uom.category",
|
|
5083
|
+
"res.country",
|
|
5084
|
+
"res.country.state",
|
|
5085
|
+
"res.lang",
|
|
5086
|
+
"product.pricelist",
|
|
5087
|
+
"product.pricelist.item",
|
|
5088
|
+
"product.category",
|
|
5089
|
+
"account.cash.rounding",
|
|
5090
|
+
"account.fiscal.position",
|
|
5091
|
+
"account.fiscal.position.tax",
|
|
5092
|
+
"stock.picking.type",
|
|
5093
|
+
"res.currency",
|
|
5094
|
+
"pos.note",
|
|
5095
|
+
"ir.ui.view",
|
|
5096
|
+
"product.tag",
|
|
5097
|
+
"ir.module.module"
|
|
5098
|
+
]
|
|
5099
|
+
}
|
|
5100
|
+
};
|
|
5101
|
+
return env?.requests.post(
|
|
5102
|
+
"/call" /* CALL_PATH */,
|
|
5103
|
+
jsonData,
|
|
5104
|
+
{
|
|
5105
|
+
headers: {
|
|
5106
|
+
"Content-Type": "application/json",
|
|
5107
|
+
...xNode ? { "X-Node": xNode } : {}
|
|
5108
|
+
}
|
|
5109
|
+
},
|
|
5110
|
+
service
|
|
5111
|
+
);
|
|
5112
|
+
},
|
|
5113
|
+
[env]
|
|
5114
|
+
);
|
|
5042
5115
|
return {
|
|
5043
5116
|
getView,
|
|
5044
5117
|
getMenu,
|
|
@@ -5064,7 +5137,8 @@ function useViewService() {
|
|
|
5064
5137
|
createEntity,
|
|
5065
5138
|
getList,
|
|
5066
5139
|
updateEntity,
|
|
5067
|
-
deleteEntity
|
|
5140
|
+
deleteEntity,
|
|
5141
|
+
loadDataPosSession
|
|
5068
5142
|
};
|
|
5069
5143
|
}
|
|
5070
5144
|
// Annotate the CommonJS export names for ESM import in node:
|