2
0
mirror of https://github.com/frappe/books.git synced 2025-01-09 09:50:27 +00:00

feat: erpnextSync settings page

This commit is contained in:
akshayitzme 2024-10-24 09:51:45 +05:30
parent 3d94b4b8ea
commit c2d7644269

View File

@ -129,6 +129,7 @@ export default defineComponent({
ModelNameEnum.InventorySettings,
ModelNameEnum.Defaults,
ModelNameEnum.POSSettings,
ModelNameEnum.ERPNextSyncSettings,
ModelNameEnum.PrintSettings,
ModelNameEnum.SystemSettings,
].some((s) => this.fyo.singles[s]?.canSave);
@ -148,6 +149,7 @@ export default defineComponent({
[ModelNameEnum.InventorySettings]: this.t`Inventory`,
[ModelNameEnum.Defaults]: this.t`Defaults`,
[ModelNameEnum.POSSettings]: this.t`POS Settings`,
[ModelNameEnum.ERPNextSyncSettings]: this.t`ERPNext Sync`,
[ModelNameEnum.SystemSettings]: this.t`System`,
};
},
@ -156,12 +158,15 @@ export default defineComponent({
!!this.fyo.singles.AccountingSettings?.enableInventory;
const enablePOS = !!this.fyo.singles.InventorySettings?.enablePointOfSale;
const enableERPNextSync =
!!this.fyo.singles.AccountingSettings?.enableERPNextSync;
return [
ModelNameEnum.AccountingSettings,
ModelNameEnum.InventorySettings,
ModelNameEnum.Defaults,
ModelNameEnum.POSSettings,
ModelNameEnum.ERPNextSyncSettings,
ModelNameEnum.PrintSettings,
ModelNameEnum.SystemSettings,
]
@ -173,6 +178,11 @@ export default defineComponent({
if (s === ModelNameEnum.POSSettings && !enablePOS) {
return false;
}
if (s === ModelNameEnum.ERPNextSyncSettings && !enableERPNextSync) {
return false;
}
return true;
})
.map((s) => this.fyo.schemaMap[s]!);