Compare commits

...

1 Commits

Author SHA1 Message Date
Ankush Menat
e576a9c7c1 fix: using DN for transfer w/o internal customer (#27798)
This used to be work before though not "advertised", since a lot of
users have started using it as feature, it can't be broken now.

(cherry picked from commit df1f8fddf6)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
#	erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
2025-02-01 00:13:19 +00:00
3 changed files with 20 additions and 1 deletions

View File

@@ -2617,6 +2617,7 @@ class TestSalesInvoice(IntegrationTestCase):
self.assertEqual(target_doc.company, "_Test Company 1")
self.assertEqual(target_doc.supplier, "_Test Internal Supplier")
<<<<<<< HEAD
def test_inter_company_transaction_without_default_warehouse(self):
"Check mapping (expense account) of inter company SI to PI in absence of default warehouse."
# setup
@@ -2671,6 +2672,8 @@ class TestSalesInvoice(IntegrationTestCase):
frappe.local.enable_perpetual_inventory["_Test Company 1"] = old_perpetual_inventory
frappe.db.set_single_value("Stock Settings", "allow_negative_stock", old_negative_stock)
=======
>>>>>>> df1f8fddf6 (fix: using DN for transfer w/o internal customer (#27798))
def test_sle_for_target_warehouse(self):
se = make_stock_entry(
item_code="138-CMS Shoe",

View File

@@ -782,6 +782,12 @@ class SellingController(StockController):
msg += " " + _("This {} will be treated as material transfer.").format(_(self.doctype))
frappe.msgprint(msg, title="Internal Transfer", alert=True)
if not self.get("is_internal_customer") and any(d.get("target_warehouse") for d in items):
msg = _("Target Warehouse set for some items but the customer is not an internal customer.")
msg += " " + _("This {} will be treated as material transfer.").format(_(self.doctype))
frappe.msgprint(msg, title="Internal Transfer")
def validate_items(self):
# validate items to see if they have is_sales_item enabled
from erpnext.controllers.buying_controller import validate_item_type

View File

@@ -940,14 +940,24 @@
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
<<<<<<< HEAD
"modified": "2024-11-21 16:37:37.441498",
=======
"modified": "2021-10-05 12:12:44.018872",
>>>>>>> df1f8fddf6 (fix: using DN for transfer w/o internal customer (#27798))
"modified_by": "Administrator",
"module": "Stock",
"name": "Delivery Note Item",
"naming_rule": "Random",
"owner": "Administrator",
"permissions": [],
<<<<<<< HEAD
"sort_field": "creation",
"sort_order": "DESC",
"states": []
}
}
=======
"sort_field": "modified",
"sort_order": "DESC"
}
>>>>>>> df1f8fddf6 (fix: using DN for transfer w/o internal customer (#27798))