-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 (cherry picked from commit 231fe41)
- Loading branch information
1 parent
574791f
commit 117dbe3
Showing
4 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |