Skip to content

Commit

Permalink
Assign pricelist items based on categories
Browse files Browse the repository at this point in the history
  • Loading branch information
santostelmo committed Jan 21, 2025
1 parent ee52209 commit b6d0567
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,22 @@ const PosPartnerPricelistLoadBackgroundSPosGlobalState = (PosGlobalState) =>
correspondingProduct,
pricelistItem
);
}
if (pricelistItem.product_tmpl_id) {
} else if (pricelistItem.product_tmpl_id) {
for (const product of Object.values(this.db.product_by_id).filter(
(x) => x.product_tmpl_id === pricelistItem.product_tmpl_id[0]
)) {
this._assignApplicableItems(pricelist, product, pricelistItem);
}
} else {
for (const correspondingProduct of Object.values(
this.db.product_by_id
).filter((x) => x.categ_id)) {
this._assignApplicableItems(
pricelist,
correspondingProduct,
pricelistItem
);
}
}
}
}
Expand Down

0 comments on commit b6d0567

Please sign in to comment.