fix: added filter in item visibility

This commit is contained in:
Gadha2311
2026-02-02 14:55:38 +05:30
parent 0d9c079e1d
commit 5e558badc4
3 changed files with 26 additions and 2 deletions
+9 -1
View File
@@ -667,8 +667,16 @@ export abstract class InvoiceItem extends Doc {
if (enableERPNextSync) {
const itemVisibility = await getItemVisibility(doc.fyo);
if (itemVisibility === 'ERP Sync Items') {
if (itemVisibility === 'Inventory Items') {
filters.trackItem = true;
} else if (itemVisibility === 'ERP Sync Items') {
filters.datafromErp = true;
} else if (itemVisibility === 'Non-Inventory Items') {
filters.trackItem = false;
filters.datafromErp = false;
} else {
filters.trackItem = false;
filters.datafromErp = false;
}
}
+3
View File
@@ -703,6 +703,9 @@ export default defineComponent({
filters.trackItem = true;
} else if (itemVisibility === 'ERP Sync Items') {
filters.datafromErp = true;
} else if (itemVisibility === 'Non-Inventory Items') {
filters.trackItem = false;
filters.datafromErp = false;
} else {
filters.trackItem = false;
filters.datafromErp = false;
+14 -1
View File
@@ -243,6 +243,10 @@ async function createNewDocument(
token: string,
deviceID: string
) {
if (getDocTypeName(doc) === ModelNameEnum.Item) {
doc.datafromErp = true;
}
const newDoc = fyo.doc.getNewDoc(getDocTypeName(doc), doc);
await performPreSync(fyo, doc);
await appendDocValues(newDoc as DocValueMap, doc);
@@ -451,8 +455,13 @@ async function updateExistingDocument(
token: string,
deviceID: string
) {
const docType = getDocTypeName(doc);
if (docType === ModelNameEnum.Item) {
}
const existingDoc = await fyo.doc.getDoc(
getDocTypeName(doc),
docType,
(doc.fbooksDocName as string) || (doc.name as string)
);
@@ -537,6 +546,10 @@ export async function performInitialFullSync(fyo: Fyo) {
if (docsByType[docType] && docsByType[docType].length > 0) {
for (const doc of docsByType[docType]) {
try {
if (docType === ModelNameEnum.Item) {
doc.datafromErp = true;
}
const isDocExists = await fyo.db.exists(
docType,
(doc.fbooksDocName as string) || (doc.name as string)