mirror of
https://github.com/frappe/books.git
synced 2025-01-08 17:24:05 +00:00
fix: reset template builder doc on navigating away
- add print templates to search
This commit is contained in:
parent
2007e4339d
commit
f6ce646477
@ -18,7 +18,7 @@
|
||||
{{ t`Save as PDF` }}
|
||||
</Button>
|
||||
<Button
|
||||
v-if="doc && displayDoc"
|
||||
v-if="doc && doc.isCustom && displayDoc"
|
||||
:title="t`Toggle Edit Mode`"
|
||||
:icon="true"
|
||||
@click="toggleEditMode"
|
||||
@ -315,6 +315,7 @@ export default defineComponent({
|
||||
}
|
||||
},
|
||||
async activated(): Promise<void> {
|
||||
await this.initialize();
|
||||
docsPathRef.value = docsPathMap.PrintTemplate ?? '';
|
||||
this.setShortcuts();
|
||||
},
|
||||
@ -323,6 +324,7 @@ export default defineComponent({
|
||||
if (this.editMode) {
|
||||
this.disableEditMode();
|
||||
}
|
||||
this.reset();
|
||||
},
|
||||
methods: {
|
||||
setShortcuts() {
|
||||
@ -357,6 +359,10 @@ export default defineComponent({
|
||||
|
||||
await this.setDisplayInitialDoc();
|
||||
},
|
||||
reset() {
|
||||
this.doc = null;
|
||||
this.displayDoc = null;
|
||||
},
|
||||
getTemplateEditorState() {
|
||||
const fallback = this.doc?.template ?? '';
|
||||
|
||||
|
@ -191,6 +191,7 @@ function getListViewList(fyo: Fyo): SearchItem[] {
|
||||
ModelNameEnum.AccountingLedgerEntry,
|
||||
ModelNameEnum.Currency,
|
||||
ModelNameEnum.NumberSeries,
|
||||
ModelNameEnum.PrintTemplate,
|
||||
];
|
||||
|
||||
const hasInventory = fyo.doc.singles.AccountingSettings?.enableInventory;
|
||||
|
Loading…
Reference in New Issue
Block a user