mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 10:49:09 +00:00
fix: should never get cutomer price on purchase document (#34002)
* fix: never get cutomer price on purchase document chores: syntax chore: typo in stock_entry get_uom_details (#33998) fix: typo in stock_entry get_uom_details chores: syntax * feat: add test for get_item_detail price list oriented * feat: add test for get_item_detail price price oriented * feat: add test for get_item_detail price price oriented * chore: clean test code
This commit is contained in:
40
erpnext/stock/tests/test_get_item_details.py
Normal file
40
erpnext/stock/tests/test_get_item_details.py
Normal file
@@ -0,0 +1,40 @@
|
||||
import json
|
||||
|
||||
import frappe
|
||||
from frappe.test_runner import make_test_records
|
||||
from frappe.tests.utils import FrappeTestCase
|
||||
|
||||
from erpnext.stock.get_item_details import get_item_details
|
||||
|
||||
test_ignore = ["BOM"]
|
||||
test_dependencies = ["Customer", "Supplier", "Item", "Price List", "Item Price"]
|
||||
|
||||
|
||||
class TestGetItemDetail(FrappeTestCase):
|
||||
def setUp(self):
|
||||
make_test_records("Price List")
|
||||
super().setUp()
|
||||
|
||||
def test_get_item_detail_purchase_order(self):
|
||||
|
||||
args = frappe._dict(
|
||||
{
|
||||
"item_code": "_Test Item",
|
||||
"company": "_Test Company",
|
||||
"customer": "_Test Customer",
|
||||
"conversion_rate": 1.0,
|
||||
"price_list_currency": "USD",
|
||||
"plc_conversion_rate": 1.0,
|
||||
"doctype": "Purchase Order",
|
||||
"name": None,
|
||||
"supplier": "_Test Supplier",
|
||||
"transaction_date": None,
|
||||
"conversion_rate": 1.0,
|
||||
"price_list": "_Test Buying Price List",
|
||||
"is_subcontracted": 0,
|
||||
"ignore_pricing_rule": 1,
|
||||
"qty": 1,
|
||||
}
|
||||
)
|
||||
details = get_item_details(args)
|
||||
self.assertEqual(details.get("price_list_rate"), 100)
|
||||
Reference in New Issue
Block a user