forked from newmatik/eso-erpnext
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request frappe#34068 from frappe/mergify/bp/version-13-hot…
…fix/pr-34002 fix: should never get cutomer price on purchase document (backport frappe#34002)
- Loading branch information
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) |