Skip to content

Commit

Permalink
fix: barcode clone and jinja dynamicData (#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
maharshivpatel authored Jul 5, 2024
2 parents 23020b4 + a870878 commit d730b87
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,14 @@ onMounted(() => {
hiddenFields.value = MainStore.isHiddenFieldsVisible;
}
fieldnames.value.forEach(async (field) => {
let rowValue = null;
if (props.table) {
rowValue = MainStore.docData[props.table.fieldname][0];
field.value = await getFormattedValue(field, rowValue);
} else {
field.value = await getFormattedValue(field, null);
if (field.fieldtype != "StaticText" || !field.parseJinja) {
let rowValue = null;
if (props.table) {
rowValue = MainStore.docData[props.table.fieldname][0];
field.value = await getFormattedValue(field, rowValue);
} else {
field.value = await getFormattedValue(field, null);
}
}
});
}
Expand Down
4 changes: 2 additions & 2 deletions print_designer/public/js/print_designer/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ export const setCurrentElement = (event, element) => {
};
const childrensCleanUp = (parentElement, element, isClone, isMainElement) => {
const MainStore = useMainStore();
const ElementStore = useElementStore();
!isMainElement && (element = { ...element });
!isClone && element && deleteSnapObjects(element);
element.id = frappe.utils.get_random(10);
Expand All @@ -169,7 +168,8 @@ const childrensCleanUp = (parentElement, element, isClone, isMainElement) => {
element.snapEdges = [];
if (
element.type == "table" ||
(["text", "image", "barcode"].indexOf(element.type) != -1 && element.isDynamic)
element.type == "barcode" ||
(["text", "image"].indexOf(element.type) != -1 && element.isDynamic)
) {
if (["text", "barcode"].indexOf(element.type) != -1) {
element.dynamicContent = [
Expand Down

0 comments on commit d730b87

Please sign in to comment.