@fctc/interface-logic 2.3.0 → 2.3.1
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/configs.js +1 -1
- package/dist/configs.mjs +1 -1
- package/dist/environment.js +1 -1
- package/dist/environment.mjs +1 -1
- package/dist/hooks.d.mts +9 -2
- package/dist/hooks.d.ts +9 -2
- package/dist/hooks.js +128 -81
- package/dist/hooks.mjs +97 -51
- package/dist/provider.d.mts +8 -8
- package/dist/provider.d.ts +8 -8
- package/dist/provider.js +128 -82
- package/dist/provider.mjs +98 -52
- package/dist/services.d.mts +7 -1
- package/dist/services.d.ts +7 -1
- package/dist/services.js +73 -41
- package/dist/services.mjs +58 -26
- package/package.json +85 -85
package/dist/provider.mjs
CHANGED
|
@@ -3533,6 +3533,35 @@ function useFormService() {
|
|
|
3533
3533
|
},
|
|
3534
3534
|
[env]
|
|
3535
3535
|
);
|
|
3536
|
+
const saveFile = useCallback5(
|
|
3537
|
+
async ({
|
|
3538
|
+
model,
|
|
3539
|
+
idForm,
|
|
3540
|
+
idFile,
|
|
3541
|
+
context
|
|
3542
|
+
}) => {
|
|
3543
|
+
const jsonData = {
|
|
3544
|
+
model,
|
|
3545
|
+
method: "web_save" /* WEB_SAVE */,
|
|
3546
|
+
ids: [
|
|
3547
|
+
[idForm],
|
|
3548
|
+
{
|
|
3549
|
+
attachment_ids: [[4, idFile]]
|
|
3550
|
+
}
|
|
3551
|
+
],
|
|
3552
|
+
kwargs: {
|
|
3553
|
+
context,
|
|
3554
|
+
specification: {}
|
|
3555
|
+
}
|
|
3556
|
+
};
|
|
3557
|
+
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3558
|
+
headers: {
|
|
3559
|
+
"Content-Type": "application/json"
|
|
3560
|
+
}
|
|
3561
|
+
});
|
|
3562
|
+
},
|
|
3563
|
+
[env]
|
|
3564
|
+
);
|
|
3536
3565
|
const getFormView = useCallback5(
|
|
3537
3566
|
async ({ data }) => {
|
|
3538
3567
|
const jsonData = {
|
|
@@ -3586,7 +3615,8 @@ function useFormService() {
|
|
|
3586
3615
|
uploadImage,
|
|
3587
3616
|
getFormView,
|
|
3588
3617
|
changeStatus,
|
|
3589
|
-
uploadFile
|
|
3618
|
+
uploadFile,
|
|
3619
|
+
saveFile
|
|
3590
3620
|
};
|
|
3591
3621
|
}
|
|
3592
3622
|
|
|
@@ -4139,8 +4169,7 @@ function useViewService() {
|
|
|
4139
4169
|
[env]
|
|
4140
4170
|
);
|
|
4141
4171
|
const getMenu = useCallback9(
|
|
4142
|
-
async (context, specification
|
|
4143
|
-
console.log("domain", domain);
|
|
4172
|
+
async (context, specification) => {
|
|
4144
4173
|
const jsonData = {
|
|
4145
4174
|
model: "ir.ui.menu" /* MENU */,
|
|
4146
4175
|
method: "web_search_read" /* WEB_SEARCH_READ */,
|
|
@@ -4148,7 +4177,7 @@ function useViewService() {
|
|
|
4148
4177
|
with_context: context,
|
|
4149
4178
|
kwargs: {
|
|
4150
4179
|
specification,
|
|
4151
|
-
domain:
|
|
4180
|
+
domain: [
|
|
4152
4181
|
"&",
|
|
4153
4182
|
["is_display", "=", true],
|
|
4154
4183
|
"&",
|
|
@@ -4700,7 +4729,7 @@ var axiosClient = {
|
|
|
4700
4729
|
}
|
|
4701
4730
|
const getBaseUrl = (baseUrl, serviceName) => {
|
|
4702
4731
|
const service = serviceName || config?.default_service;
|
|
4703
|
-
return `${baseUrl.replace(/\/$/, "")}/${service}/api/v2`;
|
|
4732
|
+
return config?.default_service === "" ? `${baseUrl.replace(/\/$/, "")}/api/v2` : `${baseUrl.replace(/\/$/, "")}/${service}/api/v2`;
|
|
4704
4733
|
};
|
|
4705
4734
|
const responseBody = (response) => response;
|
|
4706
4735
|
const requests = {
|
|
@@ -5338,11 +5367,26 @@ var useUploadFile = () => {
|
|
|
5338
5367
|
};
|
|
5339
5368
|
var use_upload_file_default = useUploadFile;
|
|
5340
5369
|
|
|
5341
|
-
// src/hooks/
|
|
5370
|
+
// src/hooks/form/use-save-file.ts
|
|
5342
5371
|
import { useMutation as useMutation26 } from "@tanstack/react-query";
|
|
5372
|
+
var useSaveFile = () => {
|
|
5373
|
+
const { saveFile } = useFormService();
|
|
5374
|
+
return useMutation26({
|
|
5375
|
+
mutationFn: ({
|
|
5376
|
+
model,
|
|
5377
|
+
idForm,
|
|
5378
|
+
idFile,
|
|
5379
|
+
context
|
|
5380
|
+
}) => saveFile({ model, idForm, idFile, context })
|
|
5381
|
+
});
|
|
5382
|
+
};
|
|
5383
|
+
var use_save_file_default = useSaveFile;
|
|
5384
|
+
|
|
5385
|
+
// src/hooks/model/use-delete.ts
|
|
5386
|
+
import { useMutation as useMutation27 } from "@tanstack/react-query";
|
|
5343
5387
|
var useDelete = () => {
|
|
5344
5388
|
const { deleteApi } = useModelService();
|
|
5345
|
-
return
|
|
5389
|
+
return useMutation27({
|
|
5346
5390
|
mutationFn: ({ ids, model, service }) => deleteApi({ ids, model, service })
|
|
5347
5391
|
});
|
|
5348
5392
|
};
|
|
@@ -5398,10 +5442,10 @@ var useGetCurrency = () => {
|
|
|
5398
5442
|
var use_get_currency_default = useGetCurrency;
|
|
5399
5443
|
|
|
5400
5444
|
// src/hooks/model/use-get-detail.ts
|
|
5401
|
-
import { useMutation as
|
|
5445
|
+
import { useMutation as useMutation28 } from "@tanstack/react-query";
|
|
5402
5446
|
var useGetDetail = () => {
|
|
5403
5447
|
const { getDetail } = useModelService();
|
|
5404
|
-
return
|
|
5448
|
+
return useMutation28({
|
|
5405
5449
|
mutationFn: ({
|
|
5406
5450
|
model,
|
|
5407
5451
|
ids,
|
|
@@ -5512,7 +5556,8 @@ var BaseModel = class {
|
|
|
5512
5556
|
spec[field?.name] = {
|
|
5513
5557
|
fields: {
|
|
5514
5558
|
id: {},
|
|
5515
|
-
display_name: {}
|
|
5559
|
+
display_name: {},
|
|
5560
|
+
...field?.widget === "many2many_binary" ? { mimetype: {} } : {}
|
|
5516
5561
|
}
|
|
5517
5562
|
};
|
|
5518
5563
|
}
|
|
@@ -5603,10 +5648,10 @@ var useOdooDataTransform = () => {
|
|
|
5603
5648
|
var use_odoo_data_transform_default = useOdooDataTransform;
|
|
5604
5649
|
|
|
5605
5650
|
// src/hooks/model/use-onchange-form.ts
|
|
5606
|
-
import { useMutation as
|
|
5651
|
+
import { useMutation as useMutation29 } from "@tanstack/react-query";
|
|
5607
5652
|
var useOnChangeForm = () => {
|
|
5608
5653
|
const { onChange } = useModelService();
|
|
5609
|
-
return
|
|
5654
|
+
return useMutation29({
|
|
5610
5655
|
mutationFn: ({
|
|
5611
5656
|
ids,
|
|
5612
5657
|
model,
|
|
@@ -5629,10 +5674,10 @@ var useOnChangeForm = () => {
|
|
|
5629
5674
|
var use_onchange_form_default = useOnChangeForm;
|
|
5630
5675
|
|
|
5631
5676
|
// src/hooks/model/use-save.ts
|
|
5632
|
-
import { useMutation as
|
|
5677
|
+
import { useMutation as useMutation30 } from "@tanstack/react-query";
|
|
5633
5678
|
var useSave = () => {
|
|
5634
5679
|
const { save } = useModelService();
|
|
5635
|
-
return
|
|
5680
|
+
return useMutation30({
|
|
5636
5681
|
mutationFn: ({
|
|
5637
5682
|
ids,
|
|
5638
5683
|
model,
|
|
@@ -5647,20 +5692,20 @@ var useSave = () => {
|
|
|
5647
5692
|
var use_save_default = useSave;
|
|
5648
5693
|
|
|
5649
5694
|
// src/hooks/user/use-get-profile.ts
|
|
5650
|
-
import { useMutation as
|
|
5695
|
+
import { useMutation as useMutation31 } from "@tanstack/react-query";
|
|
5651
5696
|
var useGetProfile = (path) => {
|
|
5652
5697
|
const { getProfile } = useUserService();
|
|
5653
|
-
return
|
|
5698
|
+
return useMutation31({
|
|
5654
5699
|
mutationFn: () => getProfile(path)
|
|
5655
5700
|
});
|
|
5656
5701
|
};
|
|
5657
5702
|
var use_get_profile_default = useGetProfile;
|
|
5658
5703
|
|
|
5659
5704
|
// src/hooks/user/use-get-user.ts
|
|
5660
|
-
import { useMutation as
|
|
5705
|
+
import { useMutation as useMutation32 } from "@tanstack/react-query";
|
|
5661
5706
|
var useGetUser = () => {
|
|
5662
5707
|
const { getUser } = useUserService();
|
|
5663
|
-
return
|
|
5708
|
+
return useMutation32({
|
|
5664
5709
|
mutationFn: ({ id, context }) => getUser({
|
|
5665
5710
|
id,
|
|
5666
5711
|
context
|
|
@@ -5670,10 +5715,10 @@ var useGetUser = () => {
|
|
|
5670
5715
|
var use_get_user_default = useGetUser;
|
|
5671
5716
|
|
|
5672
5717
|
// src/hooks/user/use-switch-locale.ts
|
|
5673
|
-
import { useMutation as
|
|
5718
|
+
import { useMutation as useMutation33 } from "@tanstack/react-query";
|
|
5674
5719
|
var useSwitchLocale = () => {
|
|
5675
5720
|
const { switchUserLocale } = useUserService();
|
|
5676
|
-
return
|
|
5721
|
+
return useMutation33({
|
|
5677
5722
|
mutationFn: ({ data }) => {
|
|
5678
5723
|
return switchUserLocale({
|
|
5679
5724
|
id: data.id,
|
|
@@ -5685,10 +5730,10 @@ var useSwitchLocale = () => {
|
|
|
5685
5730
|
var use_switch_locale_default = useSwitchLocale;
|
|
5686
5731
|
|
|
5687
5732
|
// src/hooks/view/use-button.ts
|
|
5688
|
-
import { useMutation as
|
|
5733
|
+
import { useMutation as useMutation34 } from "@tanstack/react-query";
|
|
5689
5734
|
var useButton = () => {
|
|
5690
5735
|
const { callButton } = useActionService();
|
|
5691
|
-
return
|
|
5736
|
+
return useMutation34({
|
|
5692
5737
|
mutationFn: ({
|
|
5693
5738
|
model,
|
|
5694
5739
|
ids,
|
|
@@ -5710,10 +5755,10 @@ var useButton = () => {
|
|
|
5710
5755
|
var use_button_default = useButton;
|
|
5711
5756
|
|
|
5712
5757
|
// src/hooks/view/use-duplicate-record.ts
|
|
5713
|
-
import { useMutation as
|
|
5758
|
+
import { useMutation as useMutation35 } from "@tanstack/react-query";
|
|
5714
5759
|
var useDuplicateRecord = () => {
|
|
5715
5760
|
const { duplicateRecord } = useActionService();
|
|
5716
|
-
return
|
|
5761
|
+
return useMutation35({
|
|
5717
5762
|
mutationFn: ({
|
|
5718
5763
|
id,
|
|
5719
5764
|
model,
|
|
@@ -5825,11 +5870,11 @@ var use_get_list_data_default = useGetListData;
|
|
|
5825
5870
|
|
|
5826
5871
|
// src/hooks/view/use-get-menu.ts
|
|
5827
5872
|
import { useQuery as useQuery15 } from "@tanstack/react-query";
|
|
5828
|
-
var useGetMenu = (context, specification, enabled
|
|
5873
|
+
var useGetMenu = (context, specification, enabled) => {
|
|
5829
5874
|
const { getMenu } = useViewService();
|
|
5830
5875
|
return useQuery15({
|
|
5831
5876
|
queryKey: ["menus" /* MENU */, context],
|
|
5832
|
-
queryFn: () => getMenu(context, specification
|
|
5877
|
+
queryFn: () => getMenu(context, specification).then((res) => {
|
|
5833
5878
|
if (res && res?.records && res?.records?.length > 0) {
|
|
5834
5879
|
return res?.records;
|
|
5835
5880
|
}
|
|
@@ -5843,10 +5888,10 @@ var useGetMenu = (context, specification, enabled, domain) => {
|
|
|
5843
5888
|
var use_get_menu_default = useGetMenu;
|
|
5844
5889
|
|
|
5845
5890
|
// src/hooks/view/use-get-print-report.ts
|
|
5846
|
-
import { useMutation as
|
|
5891
|
+
import { useMutation as useMutation36 } from "@tanstack/react-query";
|
|
5847
5892
|
var useGetPrintReport = () => {
|
|
5848
5893
|
const { getPrintReportName } = useActionService();
|
|
5849
|
-
return
|
|
5894
|
+
return useMutation36({
|
|
5850
5895
|
mutationFn: ({ id }) => getPrintReportName({
|
|
5851
5896
|
id
|
|
5852
5897
|
})
|
|
@@ -5914,10 +5959,10 @@ var useGetView = (viewParams, actData) => {
|
|
|
5914
5959
|
var use_get_view_default = useGetView;
|
|
5915
5960
|
|
|
5916
5961
|
// src/hooks/view/use-load-action.ts
|
|
5917
|
-
import { useMutation as
|
|
5962
|
+
import { useMutation as useMutation37 } from "@tanstack/react-query";
|
|
5918
5963
|
var useLoadAction = () => {
|
|
5919
5964
|
const { loadAction } = useActionService();
|
|
5920
|
-
return
|
|
5965
|
+
return useMutation37({
|
|
5921
5966
|
mutationFn: ({
|
|
5922
5967
|
idAction,
|
|
5923
5968
|
context,
|
|
@@ -5946,10 +5991,10 @@ var useLoadMessage = () => {
|
|
|
5946
5991
|
var use_load_message_default = useLoadMessage;
|
|
5947
5992
|
|
|
5948
5993
|
// src/hooks/view/use-print.ts
|
|
5949
|
-
import { useMutation as
|
|
5994
|
+
import { useMutation as useMutation38 } from "@tanstack/react-query";
|
|
5950
5995
|
var usePrint = () => {
|
|
5951
5996
|
const { print } = useActionService();
|
|
5952
|
-
return
|
|
5997
|
+
return useMutation38({
|
|
5953
5998
|
mutationFn: ({ id, report, db }) => print({
|
|
5954
5999
|
id,
|
|
5955
6000
|
report,
|
|
@@ -5960,10 +6005,10 @@ var usePrint = () => {
|
|
|
5960
6005
|
var use_print_default = usePrint;
|
|
5961
6006
|
|
|
5962
6007
|
// src/hooks/view/use-remove-row.ts
|
|
5963
|
-
import { useMutation as
|
|
6008
|
+
import { useMutation as useMutation39 } from "@tanstack/react-query";
|
|
5964
6009
|
var useRemoveRow = () => {
|
|
5965
6010
|
const { removeRows } = useActionService();
|
|
5966
|
-
return
|
|
6011
|
+
return useMutation39({
|
|
5967
6012
|
mutationFn: ({
|
|
5968
6013
|
model,
|
|
5969
6014
|
ids,
|
|
@@ -5998,10 +6043,10 @@ var useGetResequence = (model, resIds, context, offset) => {
|
|
|
5998
6043
|
var use_resequence_default = useGetResequence;
|
|
5999
6044
|
|
|
6000
6045
|
// src/hooks/view/use-run-action.ts
|
|
6001
|
-
import { useMutation as
|
|
6046
|
+
import { useMutation as useMutation40 } from "@tanstack/react-query";
|
|
6002
6047
|
var useRunAction = () => {
|
|
6003
6048
|
const { runAction } = useActionService();
|
|
6004
|
-
return
|
|
6049
|
+
return useMutation40({
|
|
6005
6050
|
mutationFn: ({
|
|
6006
6051
|
idAction,
|
|
6007
6052
|
context,
|
|
@@ -6016,10 +6061,10 @@ var useRunAction = () => {
|
|
|
6016
6061
|
var use_run_action_default = useRunAction;
|
|
6017
6062
|
|
|
6018
6063
|
// src/hooks/view/use-signin-sso.ts
|
|
6019
|
-
import { useMutation as
|
|
6064
|
+
import { useMutation as useMutation41 } from "@tanstack/react-query";
|
|
6020
6065
|
var useSignInSSO = () => {
|
|
6021
6066
|
const { signInSSO } = useViewService();
|
|
6022
|
-
return
|
|
6067
|
+
return useMutation41({
|
|
6023
6068
|
mutationFn: ({
|
|
6024
6069
|
redirect_uri,
|
|
6025
6070
|
state,
|
|
@@ -6042,10 +6087,10 @@ var useSignInSSO = () => {
|
|
|
6042
6087
|
var use_signin_sso_default = useSignInSSO;
|
|
6043
6088
|
|
|
6044
6089
|
// src/hooks/view/use-verify-2FA.ts
|
|
6045
|
-
import { useMutation as
|
|
6090
|
+
import { useMutation as useMutation42 } from "@tanstack/react-query";
|
|
6046
6091
|
var useVerify2FA = () => {
|
|
6047
6092
|
const { verify2FA } = useViewService();
|
|
6048
|
-
return
|
|
6093
|
+
return useMutation42({
|
|
6049
6094
|
mutationFn: ({
|
|
6050
6095
|
method,
|
|
6051
6096
|
with_context,
|
|
@@ -6066,10 +6111,10 @@ var useVerify2FA = () => {
|
|
|
6066
6111
|
var use_verify_2FA_default = useVerify2FA;
|
|
6067
6112
|
|
|
6068
6113
|
// src/hooks/view/uset-get-2FA-method.ts
|
|
6069
|
-
import { useMutation as
|
|
6114
|
+
import { useMutation as useMutation43 } from "@tanstack/react-query";
|
|
6070
6115
|
var useGet2FAMethods = () => {
|
|
6071
6116
|
const { get2FAMethods } = useViewService();
|
|
6072
|
-
return
|
|
6117
|
+
return useMutation43({
|
|
6073
6118
|
mutationFn: ({
|
|
6074
6119
|
method,
|
|
6075
6120
|
with_context
|
|
@@ -6084,10 +6129,10 @@ var useGet2FAMethods = () => {
|
|
|
6084
6129
|
var uset_get_2FA_method_default = useGet2FAMethods;
|
|
6085
6130
|
|
|
6086
6131
|
// src/hooks/view/use-grant-access.ts
|
|
6087
|
-
import { useMutation as
|
|
6132
|
+
import { useMutation as useMutation44 } from "@tanstack/react-query";
|
|
6088
6133
|
var useGrantAccess = () => {
|
|
6089
6134
|
const { grantAccess } = useViewService();
|
|
6090
|
-
return
|
|
6135
|
+
return useMutation44({
|
|
6091
6136
|
mutationFn: ({
|
|
6092
6137
|
redirect_uri,
|
|
6093
6138
|
state,
|
|
@@ -6106,10 +6151,10 @@ var useGrantAccess = () => {
|
|
|
6106
6151
|
var use_grant_access_default = useGrantAccess;
|
|
6107
6152
|
|
|
6108
6153
|
// src/hooks/view/use-remove-totp-setup.ts
|
|
6109
|
-
import { useMutation as
|
|
6154
|
+
import { useMutation as useMutation45 } from "@tanstack/react-query";
|
|
6110
6155
|
var useRemoveTotpSetup = () => {
|
|
6111
6156
|
const { removeTotpSetUp } = useViewService();
|
|
6112
|
-
return
|
|
6157
|
+
return useMutation45({
|
|
6113
6158
|
mutationFn: ({ method, token }) => {
|
|
6114
6159
|
return removeTotpSetUp({
|
|
6115
6160
|
method,
|
|
@@ -6121,10 +6166,10 @@ var useRemoveTotpSetup = () => {
|
|
|
6121
6166
|
var use_remove_totp_setup_default = useRemoveTotpSetup;
|
|
6122
6167
|
|
|
6123
6168
|
// src/hooks/view/use-request-setup-totp.ts
|
|
6124
|
-
import { useMutation as
|
|
6169
|
+
import { useMutation as useMutation46 } from "@tanstack/react-query";
|
|
6125
6170
|
var useRequestSetupTotp = () => {
|
|
6126
6171
|
const { requestSetupTotp } = useViewService();
|
|
6127
|
-
return
|
|
6172
|
+
return useMutation46({
|
|
6128
6173
|
mutationFn: ({ method, token }) => {
|
|
6129
6174
|
return requestSetupTotp({
|
|
6130
6175
|
method,
|
|
@@ -6136,10 +6181,10 @@ var useRequestSetupTotp = () => {
|
|
|
6136
6181
|
var use_request_setup_totp_default = useRequestSetupTotp;
|
|
6137
6182
|
|
|
6138
6183
|
// src/hooks/view/use-settings-web-read-2fa.ts
|
|
6139
|
-
import { useMutation as
|
|
6184
|
+
import { useMutation as useMutation47 } from "@tanstack/react-query";
|
|
6140
6185
|
var useSettingsWebRead2fa = () => {
|
|
6141
6186
|
const { settingsWebRead2fa } = useViewService();
|
|
6142
|
-
return
|
|
6187
|
+
return useMutation47({
|
|
6143
6188
|
mutationFn: ({
|
|
6144
6189
|
method,
|
|
6145
6190
|
token,
|
|
@@ -6158,10 +6203,10 @@ var useSettingsWebRead2fa = () => {
|
|
|
6158
6203
|
var use_settings_web_read_2fa_default = useSettingsWebRead2fa;
|
|
6159
6204
|
|
|
6160
6205
|
// src/hooks/view/use-verify-totp.ts
|
|
6161
|
-
import { useMutation as
|
|
6206
|
+
import { useMutation as useMutation48 } from "@tanstack/react-query";
|
|
6162
6207
|
var useVerifyTotp = () => {
|
|
6163
6208
|
const { verifyTotp } = useViewService();
|
|
6164
|
-
return
|
|
6209
|
+
return useMutation48({
|
|
6165
6210
|
mutationFn: ({
|
|
6166
6211
|
method,
|
|
6167
6212
|
action_token,
|
|
@@ -6184,6 +6229,7 @@ var ServiceProvider = ({
|
|
|
6184
6229
|
children
|
|
6185
6230
|
}) => {
|
|
6186
6231
|
const services = {
|
|
6232
|
+
useSaveFile: use_save_file_default,
|
|
6187
6233
|
useForgotPassword: use_forgot_password_default,
|
|
6188
6234
|
useForgotPasswordSSO: use_forgotpassword_sso_default,
|
|
6189
6235
|
useGetProvider: use_get_provider_default,
|
package/dist/services.d.mts
CHANGED
|
@@ -146,6 +146,12 @@ declare function useFormService(): {
|
|
|
146
146
|
uploadFile: ({ formData }: {
|
|
147
147
|
formData: any;
|
|
148
148
|
}) => Promise<any>;
|
|
149
|
+
saveFile: ({ model, idForm, idFile, context, }: {
|
|
150
|
+
model: string;
|
|
151
|
+
idForm: any;
|
|
152
|
+
idFile: any;
|
|
153
|
+
context: any;
|
|
154
|
+
}) => Promise<any>;
|
|
149
155
|
};
|
|
150
156
|
|
|
151
157
|
type TGetGroupsParams = {
|
|
@@ -206,7 +212,7 @@ declare function useUserService(): {
|
|
|
206
212
|
|
|
207
213
|
declare function useViewService(): {
|
|
208
214
|
getView: ({ model, views, context, options, aid, service, }: GetViewParams) => Promise<any>;
|
|
209
|
-
getMenu: (context: any, specification: any
|
|
215
|
+
getMenu: (context: any, specification: any) => Promise<any>;
|
|
210
216
|
getActionDetail: (aid: number, context: any) => Promise<any>;
|
|
211
217
|
getResequence: ({ model, ids, context, offset, }: {
|
|
212
218
|
model: string;
|
package/dist/services.d.ts
CHANGED
|
@@ -146,6 +146,12 @@ declare function useFormService(): {
|
|
|
146
146
|
uploadFile: ({ formData }: {
|
|
147
147
|
formData: any;
|
|
148
148
|
}) => Promise<any>;
|
|
149
|
+
saveFile: ({ model, idForm, idFile, context, }: {
|
|
150
|
+
model: string;
|
|
151
|
+
idForm: any;
|
|
152
|
+
idFile: any;
|
|
153
|
+
context: any;
|
|
154
|
+
}) => Promise<any>;
|
|
149
155
|
};
|
|
150
156
|
|
|
151
157
|
type TGetGroupsParams = {
|
|
@@ -206,7 +212,7 @@ declare function useUserService(): {
|
|
|
206
212
|
|
|
207
213
|
declare function useViewService(): {
|
|
208
214
|
getView: ({ model, views, context, options, aid, service, }: GetViewParams) => Promise<any>;
|
|
209
|
-
getMenu: (context: any, specification: any
|
|
215
|
+
getMenu: (context: any, specification: any) => Promise<any>;
|
|
210
216
|
getActionDetail: (aid: number, context: any) => Promise<any>;
|
|
211
217
|
getResequence: ({ model, ids, context, offset, }: {
|
|
212
218
|
model: string;
|
package/dist/services.js
CHANGED
|
@@ -2938,117 +2938,120 @@ var import_react_query31 = require("@tanstack/react-query");
|
|
|
2938
2938
|
// src/hooks/form/use-upload-file.ts
|
|
2939
2939
|
var import_react_query32 = require("@tanstack/react-query");
|
|
2940
2940
|
|
|
2941
|
-
// src/hooks/
|
|
2941
|
+
// src/hooks/form/use-save-file.ts
|
|
2942
2942
|
var import_react_query33 = require("@tanstack/react-query");
|
|
2943
2943
|
|
|
2944
|
-
// src/hooks/model/use-
|
|
2944
|
+
// src/hooks/model/use-delete.ts
|
|
2945
2945
|
var import_react_query34 = require("@tanstack/react-query");
|
|
2946
2946
|
|
|
2947
|
-
// src/hooks/model/use-get-
|
|
2947
|
+
// src/hooks/model/use-get-all.ts
|
|
2948
2948
|
var import_react_query35 = require("@tanstack/react-query");
|
|
2949
2949
|
|
|
2950
|
-
// src/hooks/model/use-get-
|
|
2950
|
+
// src/hooks/model/use-get-conversion-rate.ts
|
|
2951
2951
|
var import_react_query36 = require("@tanstack/react-query");
|
|
2952
2952
|
|
|
2953
|
-
// src/hooks/model/use-get-
|
|
2953
|
+
// src/hooks/model/use-get-currency.ts
|
|
2954
2954
|
var import_react_query37 = require("@tanstack/react-query");
|
|
2955
2955
|
|
|
2956
|
-
// src/hooks/model/use-get-
|
|
2956
|
+
// src/hooks/model/use-get-detail.ts
|
|
2957
2957
|
var import_react_query38 = require("@tanstack/react-query");
|
|
2958
2958
|
|
|
2959
|
-
// src/hooks/model/use-get-
|
|
2959
|
+
// src/hooks/model/use-get-field-onchange.ts
|
|
2960
2960
|
var import_react_query39 = require("@tanstack/react-query");
|
|
2961
2961
|
|
|
2962
|
-
// src/hooks/model/use-
|
|
2962
|
+
// src/hooks/model/use-get-list-my-bank-account.ts
|
|
2963
2963
|
var import_react_query40 = require("@tanstack/react-query");
|
|
2964
2964
|
|
|
2965
|
-
// src/hooks/model/use-
|
|
2965
|
+
// src/hooks/model/use-onchange-form.ts
|
|
2966
2966
|
var import_react_query41 = require("@tanstack/react-query");
|
|
2967
2967
|
|
|
2968
|
-
// src/hooks/
|
|
2968
|
+
// src/hooks/model/use-save.ts
|
|
2969
2969
|
var import_react_query42 = require("@tanstack/react-query");
|
|
2970
2970
|
|
|
2971
|
-
// src/hooks/user/use-get-
|
|
2971
|
+
// src/hooks/user/use-get-profile.ts
|
|
2972
2972
|
var import_react_query43 = require("@tanstack/react-query");
|
|
2973
2973
|
|
|
2974
|
-
// src/hooks/user/use-
|
|
2974
|
+
// src/hooks/user/use-get-user.ts
|
|
2975
2975
|
var import_react_query44 = require("@tanstack/react-query");
|
|
2976
2976
|
|
|
2977
|
-
// src/hooks/
|
|
2977
|
+
// src/hooks/user/use-switch-locale.ts
|
|
2978
2978
|
var import_react_query45 = require("@tanstack/react-query");
|
|
2979
2979
|
|
|
2980
|
-
// src/hooks/view/use-
|
|
2980
|
+
// src/hooks/view/use-button.ts
|
|
2981
2981
|
var import_react_query46 = require("@tanstack/react-query");
|
|
2982
2982
|
|
|
2983
|
-
// src/hooks/view/use-
|
|
2983
|
+
// src/hooks/view/use-duplicate-record.ts
|
|
2984
2984
|
var import_react_query47 = require("@tanstack/react-query");
|
|
2985
2985
|
|
|
2986
|
-
// src/hooks/view/use-get-
|
|
2986
|
+
// src/hooks/view/use-get-action-detail.ts
|
|
2987
2987
|
var import_react_query48 = require("@tanstack/react-query");
|
|
2988
2988
|
|
|
2989
|
-
// src/hooks/view/use-get-
|
|
2989
|
+
// src/hooks/view/use-get-calendar.ts
|
|
2990
2990
|
var import_react_query49 = require("@tanstack/react-query");
|
|
2991
2991
|
|
|
2992
|
-
// src/hooks/view/use-get-
|
|
2992
|
+
// src/hooks/view/use-get-groups.ts
|
|
2993
2993
|
var import_react_query50 = require("@tanstack/react-query");
|
|
2994
2994
|
|
|
2995
|
-
// src/hooks/view/use-get-
|
|
2995
|
+
// src/hooks/view/use-get-list-data.ts
|
|
2996
2996
|
var import_react_query51 = require("@tanstack/react-query");
|
|
2997
2997
|
|
|
2998
|
-
// src/hooks/view/use-get-
|
|
2998
|
+
// src/hooks/view/use-get-menu.ts
|
|
2999
2999
|
var import_react_query52 = require("@tanstack/react-query");
|
|
3000
3000
|
|
|
3001
|
-
// src/hooks/view/use-get-
|
|
3001
|
+
// src/hooks/view/use-get-print-report.ts
|
|
3002
3002
|
var import_react_query53 = require("@tanstack/react-query");
|
|
3003
3003
|
|
|
3004
|
-
// src/hooks/view/use-get-
|
|
3004
|
+
// src/hooks/view/use-get-progress-bar.ts
|
|
3005
3005
|
var import_react_query54 = require("@tanstack/react-query");
|
|
3006
3006
|
|
|
3007
|
-
// src/hooks/view/use-get-
|
|
3007
|
+
// src/hooks/view/use-get-selection.ts
|
|
3008
3008
|
var import_react_query55 = require("@tanstack/react-query");
|
|
3009
3009
|
|
|
3010
|
-
// src/hooks/view/use-
|
|
3010
|
+
// src/hooks/view/use-get-view.ts
|
|
3011
3011
|
var import_react_query56 = require("@tanstack/react-query");
|
|
3012
3012
|
|
|
3013
|
-
// src/hooks/view/use-load-
|
|
3013
|
+
// src/hooks/view/use-load-action.ts
|
|
3014
3014
|
var import_react_query57 = require("@tanstack/react-query");
|
|
3015
3015
|
|
|
3016
|
-
// src/hooks/view/use-
|
|
3016
|
+
// src/hooks/view/use-load-message.ts
|
|
3017
3017
|
var import_react_query58 = require("@tanstack/react-query");
|
|
3018
3018
|
|
|
3019
|
-
// src/hooks/view/use-
|
|
3019
|
+
// src/hooks/view/use-print.ts
|
|
3020
3020
|
var import_react_query59 = require("@tanstack/react-query");
|
|
3021
3021
|
|
|
3022
|
-
// src/hooks/view/use-
|
|
3022
|
+
// src/hooks/view/use-remove-row.ts
|
|
3023
3023
|
var import_react_query60 = require("@tanstack/react-query");
|
|
3024
3024
|
|
|
3025
|
-
// src/hooks/view/use-
|
|
3025
|
+
// src/hooks/view/use-resequence.ts
|
|
3026
3026
|
var import_react_query61 = require("@tanstack/react-query");
|
|
3027
3027
|
|
|
3028
|
-
// src/hooks/view/use-
|
|
3028
|
+
// src/hooks/view/use-run-action.ts
|
|
3029
3029
|
var import_react_query62 = require("@tanstack/react-query");
|
|
3030
3030
|
|
|
3031
|
-
// src/hooks/view/use-
|
|
3031
|
+
// src/hooks/view/use-signin-sso.ts
|
|
3032
3032
|
var import_react_query63 = require("@tanstack/react-query");
|
|
3033
3033
|
|
|
3034
|
-
// src/hooks/view/
|
|
3034
|
+
// src/hooks/view/use-verify-2FA.ts
|
|
3035
3035
|
var import_react_query64 = require("@tanstack/react-query");
|
|
3036
3036
|
|
|
3037
|
-
// src/hooks/view/
|
|
3037
|
+
// src/hooks/view/uset-get-2FA-method.ts
|
|
3038
3038
|
var import_react_query65 = require("@tanstack/react-query");
|
|
3039
3039
|
|
|
3040
|
-
// src/hooks/view/use-
|
|
3040
|
+
// src/hooks/view/use-grant-access.ts
|
|
3041
3041
|
var import_react_query66 = require("@tanstack/react-query");
|
|
3042
3042
|
|
|
3043
|
-
// src/hooks/view/use-
|
|
3043
|
+
// src/hooks/view/use-remove-totp-setup.ts
|
|
3044
3044
|
var import_react_query67 = require("@tanstack/react-query");
|
|
3045
3045
|
|
|
3046
|
-
// src/hooks/view/use-
|
|
3046
|
+
// src/hooks/view/use-request-setup-totp.ts
|
|
3047
3047
|
var import_react_query68 = require("@tanstack/react-query");
|
|
3048
3048
|
|
|
3049
|
-
// src/hooks/view/use-
|
|
3049
|
+
// src/hooks/view/use-settings-web-read-2fa.ts
|
|
3050
3050
|
var import_react_query69 = require("@tanstack/react-query");
|
|
3051
3051
|
|
|
3052
|
+
// src/hooks/view/use-verify-totp.ts
|
|
3053
|
+
var import_react_query70 = require("@tanstack/react-query");
|
|
3054
|
+
|
|
3052
3055
|
// src/provider/service-provider.tsx
|
|
3053
3056
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
3054
3057
|
var ServiceContext = (0, import_react4.createContext)(null);
|
|
@@ -3746,6 +3749,35 @@ function useFormService() {
|
|
|
3746
3749
|
},
|
|
3747
3750
|
[env]
|
|
3748
3751
|
);
|
|
3752
|
+
const saveFile = (0, import_react10.useCallback)(
|
|
3753
|
+
async ({
|
|
3754
|
+
model,
|
|
3755
|
+
idForm,
|
|
3756
|
+
idFile,
|
|
3757
|
+
context
|
|
3758
|
+
}) => {
|
|
3759
|
+
const jsonData = {
|
|
3760
|
+
model,
|
|
3761
|
+
method: "web_save" /* WEB_SAVE */,
|
|
3762
|
+
ids: [
|
|
3763
|
+
[idForm],
|
|
3764
|
+
{
|
|
3765
|
+
attachment_ids: [[4, idFile]]
|
|
3766
|
+
}
|
|
3767
|
+
],
|
|
3768
|
+
kwargs: {
|
|
3769
|
+
context,
|
|
3770
|
+
specification: {}
|
|
3771
|
+
}
|
|
3772
|
+
};
|
|
3773
|
+
return env.requests.post("/call" /* CALL_PATH */, jsonData, {
|
|
3774
|
+
headers: {
|
|
3775
|
+
"Content-Type": "application/json"
|
|
3776
|
+
}
|
|
3777
|
+
});
|
|
3778
|
+
},
|
|
3779
|
+
[env]
|
|
3780
|
+
);
|
|
3749
3781
|
const getFormView = (0, import_react10.useCallback)(
|
|
3750
3782
|
async ({ data }) => {
|
|
3751
3783
|
const jsonData = {
|
|
@@ -3799,7 +3831,8 @@ function useFormService() {
|
|
|
3799
3831
|
uploadImage,
|
|
3800
3832
|
getFormView,
|
|
3801
3833
|
changeStatus,
|
|
3802
|
-
uploadFile
|
|
3834
|
+
uploadFile,
|
|
3835
|
+
saveFile
|
|
3803
3836
|
};
|
|
3804
3837
|
}
|
|
3805
3838
|
|
|
@@ -4352,8 +4385,7 @@ function useViewService() {
|
|
|
4352
4385
|
[env]
|
|
4353
4386
|
);
|
|
4354
4387
|
const getMenu = (0, import_react14.useCallback)(
|
|
4355
|
-
async (context, specification
|
|
4356
|
-
console.log("domain", domain);
|
|
4388
|
+
async (context, specification) => {
|
|
4357
4389
|
const jsonData = {
|
|
4358
4390
|
model: "ir.ui.menu" /* MENU */,
|
|
4359
4391
|
method: "web_search_read" /* WEB_SEARCH_READ */,
|
|
@@ -4361,7 +4393,7 @@ function useViewService() {
|
|
|
4361
4393
|
with_context: context,
|
|
4362
4394
|
kwargs: {
|
|
4363
4395
|
specification,
|
|
4364
|
-
domain:
|
|
4396
|
+
domain: [
|
|
4365
4397
|
"&",
|
|
4366
4398
|
["is_display", "=", true],
|
|
4367
4399
|
"&",
|