Skip to content

Commit

Permalink
Fix: missing handle while adding shared parts
Browse files Browse the repository at this point in the history
  • Loading branch information
AgustinSilverfin committed Dec 6, 2023
1 parent 621ac73 commit 7adefd6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ async function addAllSharedParts(firmId) {

for (let template of configSharedPart.used_in) {
template = SharedPart.checkReconciliationType(template);
if (!template.handle && !template.name) {
if (!template.handle) {
consola.warn(`Template has no handle or name. Skipping.`);
continue;
}
Expand All @@ -730,12 +730,17 @@ async function addAllSharedParts(firmId) {
);
if (alreadyAdded) {
consola.info(
"Template ${tempalte.type} ${template.handle} already has this shared part. Skipping."
`Template ${template.type} ${template.handle} already has this shared part. Skipping.`
);
continue;
}

addSharedPart(firmId, configSharedPart.name, handle, template.type);
addSharedPart(
firmId,
configSharedPart.name,
template.handle,
template.type
);
}
}
}
Expand Down

0 comments on commit 7adefd6

Please sign in to comment.