mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-18 12:39:18 +00:00
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
This commit is contained in:
@@ -2617,6 +2617,7 @@ class TestSalesInvoice(IntegrationTestCase):
|
|||||||
self.assertEqual(target_doc.company, "_Test Company 1")
|
self.assertEqual(target_doc.company, "_Test Company 1")
|
||||||
self.assertEqual(target_doc.supplier, "_Test Internal Supplier")
|
self.assertEqual(target_doc.supplier, "_Test Internal Supplier")
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
def test_inter_company_transaction_without_default_warehouse(self):
|
def test_inter_company_transaction_without_default_warehouse(self):
|
||||||
"Check mapping (expense account) of inter company SI to PI in absence of default warehouse."
|
"Check mapping (expense account) of inter company SI to PI in absence of default warehouse."
|
||||||
# setup
|
# setup
|
||||||
@@ -2671,6 +2672,8 @@ class TestSalesInvoice(IntegrationTestCase):
|
|||||||
frappe.local.enable_perpetual_inventory["_Test Company 1"] = old_perpetual_inventory
|
frappe.local.enable_perpetual_inventory["_Test Company 1"] = old_perpetual_inventory
|
||||||
frappe.db.set_single_value("Stock Settings", "allow_negative_stock", old_negative_stock)
|
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):
|
def test_sle_for_target_warehouse(self):
|
||||||
se = make_stock_entry(
|
se = make_stock_entry(
|
||||||
item_code="138-CMS Shoe",
|
item_code="138-CMS Shoe",
|
||||||
|
|||||||
@@ -782,6 +782,12 @@ class SellingController(StockController):
|
|||||||
msg += " " + _("This {} will be treated as material transfer.").format(_(self.doctype))
|
msg += " " + _("This {} will be treated as material transfer.").format(_(self.doctype))
|
||||||
frappe.msgprint(msg, title="Internal Transfer", alert=True)
|
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):
|
def validate_items(self):
|
||||||
# validate items to see if they have is_sales_item enabled
|
# validate items to see if they have is_sales_item enabled
|
||||||
from erpnext.controllers.buying_controller import validate_item_type
|
from erpnext.controllers.buying_controller import validate_item_type
|
||||||
|
|||||||
@@ -940,14 +940,24 @@
|
|||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
|
<<<<<<< HEAD
|
||||||
"modified": "2024-11-21 16:37:37.441498",
|
"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",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Delivery Note Item",
|
"name": "Delivery Note Item",
|
||||||
"naming_rule": "Random",
|
"naming_rule": "Random",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [],
|
"permissions": [],
|
||||||
|
<<<<<<< HEAD
|
||||||
"sort_field": "creation",
|
"sort_field": "creation",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
"states": []
|
"states": []
|
||||||
}
|
}
|
||||||
|
=======
|
||||||
|
"sort_field": "modified",
|
||||||
|
"sort_order": "DESC"
|
||||||
|
}
|
||||||
|
>>>>>>> df1f8fddf6 (fix: using DN for transfer w/o internal customer (#27798))
|
||||||
|
|||||||
Reference in New Issue
Block a user