mirror of
https://github.com/frappe/books.git
synced 2025-01-24 07:38:25 +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` }}
|
{{ t`Save as PDF` }}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
v-if="doc && displayDoc"
|
v-if="doc && doc.isCustom && displayDoc"
|
||||||
:title="t`Toggle Edit Mode`"
|
:title="t`Toggle Edit Mode`"
|
||||||
:icon="true"
|
:icon="true"
|
||||||
@click="toggleEditMode"
|
@click="toggleEditMode"
|
||||||
@ -315,6 +315,7 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async activated(): Promise<void> {
|
async activated(): Promise<void> {
|
||||||
|
await this.initialize();
|
||||||
docsPathRef.value = docsPathMap.PrintTemplate ?? '';
|
docsPathRef.value = docsPathMap.PrintTemplate ?? '';
|
||||||
this.setShortcuts();
|
this.setShortcuts();
|
||||||
},
|
},
|
||||||
@ -323,6 +324,7 @@ export default defineComponent({
|
|||||||
if (this.editMode) {
|
if (this.editMode) {
|
||||||
this.disableEditMode();
|
this.disableEditMode();
|
||||||
}
|
}
|
||||||
|
this.reset();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
setShortcuts() {
|
setShortcuts() {
|
||||||
@ -357,6 +359,10 @@ export default defineComponent({
|
|||||||
|
|
||||||
await this.setDisplayInitialDoc();
|
await this.setDisplayInitialDoc();
|
||||||
},
|
},
|
||||||
|
reset() {
|
||||||
|
this.doc = null;
|
||||||
|
this.displayDoc = null;
|
||||||
|
},
|
||||||
getTemplateEditorState() {
|
getTemplateEditorState() {
|
||||||
const fallback = this.doc?.template ?? '';
|
const fallback = this.doc?.template ?? '';
|
||||||
|
|
||||||
|
@ -191,6 +191,7 @@ function getListViewList(fyo: Fyo): SearchItem[] {
|
|||||||
ModelNameEnum.AccountingLedgerEntry,
|
ModelNameEnum.AccountingLedgerEntry,
|
||||||
ModelNameEnum.Currency,
|
ModelNameEnum.Currency,
|
||||||
ModelNameEnum.NumberSeries,
|
ModelNameEnum.NumberSeries,
|
||||||
|
ModelNameEnum.PrintTemplate,
|
||||||
];
|
];
|
||||||
|
|
||||||
const hasInventory = fyo.doc.singles.AccountingSettings?.enableInventory;
|
const hasInventory = fyo.doc.singles.AccountingSettings?.enableInventory;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user