Skip to content

Commit

Permalink
Merge pull request #38316 from frappe/mergify/bp/version-15-hotfix/pr…
Browse files Browse the repository at this point in the history
…-38269

fix: skip fixed assets in product bundle (backport #38269)
  • Loading branch information
deepeshgarg007 authored Nov 24, 2023
2 parents 18f9650 + d076aca commit 64d9c5d
Show file tree
Hide file tree
Showing 10 changed files with 147 additions and 325 deletions.
2 changes: 1 addition & 1 deletion erpnext/accounts/doctype/pos_invoice/pos_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ def get_stock_availability(item_code, warehouse):
return bin_qty - pos_sales_qty, is_stock_item
else:
is_stock_item = True
if frappe.db.exists("Product Bundle", item_code):
if frappe.db.exists("Product Bundle", {"name": item_code, "disabled": 0}):
return get_bundle_availability(item_code, warehouse), is_stock_item
else:
is_stock_item = False
Expand Down
11 changes: 6 additions & 5 deletions erpnext/controllers/selling_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,12 @@ def get_item_list(self):
return il

def has_product_bundle(self, item_code):
return frappe.db.sql(
"""select name from `tabProduct Bundle`
where new_item_code=%s and docstatus != 2""",
item_code,
)
product_bundle = frappe.qb.DocType("Product Bundle")
return (
frappe.qb.from_(product_bundle)
.select(product_bundle.name)
.where((product_bundle.new_item_code == item_code) & (product_bundle.disabled == 0))
).run()

def get_already_delivered_qty(self, current_docname, so, so_detail):
delivered_via_dn = frappe.db.sql(
Expand Down
Loading

0 comments on commit 64d9c5d

Please sign in to comment.