mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-22 14:39:19 +00:00
chore: Update test case
This commit is contained in:
@@ -897,3 +897,18 @@ def get_default_contact(doctype, name):
|
|||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def add_party_account(party_type, party, company, account):
|
||||||
|
doc = frappe.get_doc(party_type, party)
|
||||||
|
account_exists = False
|
||||||
|
for d in doc.get("accounts"):
|
||||||
|
if d.account == account:
|
||||||
|
account_exists = True
|
||||||
|
|
||||||
|
if not account_exists:
|
||||||
|
accounts = {"company": company, "account": account}
|
||||||
|
|
||||||
|
doc.append("accounts", accounts)
|
||||||
|
|
||||||
|
doc.save()
|
||||||
|
|||||||
@@ -1285,6 +1285,14 @@ class TestPurchaseReceipt(FrappeTestCase):
|
|||||||
from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import (
|
from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import (
|
||||||
make_purchase_invoice as create_purchase_invoice,
|
make_purchase_invoice as create_purchase_invoice,
|
||||||
)
|
)
|
||||||
|
from erpnext.accounts.party import add_party_account
|
||||||
|
|
||||||
|
add_party_account(
|
||||||
|
"Supplier",
|
||||||
|
"_Test Supplier USD",
|
||||||
|
"_Test Company with perpetual inventory",
|
||||||
|
"_Test Payable USD - TCP1",
|
||||||
|
)
|
||||||
|
|
||||||
pi = create_purchase_invoice(
|
pi = create_purchase_invoice(
|
||||||
company="_Test Company with perpetual inventory",
|
company="_Test Company with perpetual inventory",
|
||||||
@@ -1293,6 +1301,7 @@ class TestPurchaseReceipt(FrappeTestCase):
|
|||||||
expense_account="_Test Account Cost for Goods Sold - TCP1",
|
expense_account="_Test Account Cost for Goods Sold - TCP1",
|
||||||
currency="USD",
|
currency="USD",
|
||||||
conversion_rate=70,
|
conversion_rate=70,
|
||||||
|
supplier="_Test Supplier USD",
|
||||||
)
|
)
|
||||||
|
|
||||||
pr = create_purchase_receipt(pi.name)
|
pr = create_purchase_receipt(pi.name)
|
||||||
|
|||||||
Reference in New Issue
Block a user