fix: Don't create inward SLE against SI unless is internal customer enabled (#27086)
* fix: Dont create inward SLE against SI unless is internal customer enabled
- Check if is internal customer enabled apart from target warehouse
- Test to check if inward SLE is made if target warehouse is accidentally set but customer is not internal
* test: Use internal customer for delivery of bundle items to target warehouse
- created `create_internal_customer` util
- reused it in delivery note and sales invoice tests
- use internal customer for target warehouse test in delivery note
(cherry picked from commit f4dc9ee2aa)
# Conflicts:
# erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
This commit is contained in:
@@ -422,7 +422,7 @@ class SellingController(StockController):
|
||||
or (cint(self.is_return) and self.docstatus==2)):
|
||||
sl_entries.append(self.get_sle_for_source_warehouse(d))
|
||||
|
||||
if d.target_warehouse:
|
||||
if d.target_warehouse and self.get("is_internal_customer"):
|
||||
sl_entries.append(self.get_sle_for_target_warehouse(d))
|
||||
|
||||
if d.warehouse and ((not cint(self.is_return) and self.docstatus==2)
|
||||
|
||||
Reference in New Issue
Block a user