Skip to content

Commit

Permalink
fix: removed conditional logic for inventory models in PrintTemplate …
Browse files Browse the repository at this point in the history
…lists
  • Loading branch information
AbleKSaju committed Mar 5, 2025
1 parent ceff893 commit e4baf81
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions models/baseModels/PrintTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ export class PrintTemplate extends Doc {

static lists: ListsMap = {
type(doc?: Doc) {
let enableInventory = false;
let schemaMap: SchemaMap = {};
if (doc) {
enableInventory = !!doc.fyo.singles.AccountingSettings?.enableInventory;
schemaMap = doc.fyo.schemaMap;
}

Expand All @@ -59,16 +57,11 @@ export class PrintTemplate extends Doc {
ModelNameEnum.PurchaseInvoice,
ModelNameEnum.JournalEntry,
ModelNameEnum.Payment,
ModelNameEnum.Shipment,
ModelNameEnum.PurchaseReceipt,
ModelNameEnum.StockMovement,
];

if (enableInventory) {
models.push(
ModelNameEnum.Shipment,
ModelNameEnum.PurchaseReceipt,
ModelNameEnum.StockMovement
);
}

return models.map((value) => ({
value,
label: schemaMap[value]?.label ?? value,
Expand Down

0 comments on commit e4baf81

Please sign in to comment.