mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 16:04:46 +00:00
refactor(test): use new source for repost setting
(cherry picked from commit b8207d5ed1)
This commit is contained in:
@@ -413,9 +413,9 @@ class TestJournalEntry(ERPNextTestSuite):
|
|||||||
from erpnext.accounts.doctype.cost_center.test_cost_center import create_cost_center
|
from erpnext.accounts.doctype.cost_center.test_cost_center import create_cost_center
|
||||||
|
|
||||||
# Configure Repost Accounting Ledger for JVs
|
# Configure Repost Accounting Ledger for JVs
|
||||||
settings = frappe.get_doc("Repost Accounting Ledger Settings")
|
settings = frappe.get_doc("Accounts Settings")
|
||||||
if not [x for x in settings.allowed_types if x.document_type == "Journal Entry"]:
|
if "Journal Entry" not in [x.document_type for x in settings.repost_allowed_types]:
|
||||||
settings.append("allowed_types", {"document_type": "Journal Entry", "allowed": True})
|
settings.append("repost_allowed_types", {"document_type": "Journal Entry"})
|
||||||
settings.save()
|
settings.save()
|
||||||
|
|
||||||
# Create JV with defaut cost center - _Test Cost Center
|
# Create JV with defaut cost center - _Test Cost Center
|
||||||
|
|||||||
@@ -2256,9 +2256,9 @@ class TestPurchaseInvoice(ERPNextTestSuite, StockTestMixin):
|
|||||||
|
|
||||||
def test_repost_accounting_entries(self):
|
def test_repost_accounting_entries(self):
|
||||||
# update repost settings
|
# update repost settings
|
||||||
settings = frappe.get_doc("Repost Accounting Ledger Settings")
|
settings = frappe.get_doc("Accounts Settings")
|
||||||
if not [x for x in settings.allowed_types if x.document_type == "Purchase Invoice"]:
|
if "Purchase Invoice" not in [x.document_type for x in settings.repost_allowed_types]:
|
||||||
settings.append("allowed_types", {"document_type": "Purchase Invoice", "allowed": True})
|
settings.append("repost_allowed_types", {"document_type": "Purchase Invoice"})
|
||||||
settings.save()
|
settings.save()
|
||||||
|
|
||||||
pi = make_purchase_invoice(
|
pi = make_purchase_invoice(
|
||||||
|
|||||||
@@ -280,7 +280,8 @@ def update_repost_settings():
|
|||||||
"Journal Entry",
|
"Journal Entry",
|
||||||
"Purchase Receipt",
|
"Purchase Receipt",
|
||||||
]
|
]
|
||||||
repost_settings = frappe.get_doc("Repost Accounting Ledger Settings")
|
settings = frappe.get_doc("Accounts Settings")
|
||||||
for x in allowed_types:
|
for _type in allowed_types:
|
||||||
repost_settings.append("allowed_types", {"document_type": x, "allowed": True})
|
if _type not in [x.document_type for x in settings.repost_allowed_types]:
|
||||||
repost_settings.save()
|
settings.append("repost_allowed_types", {"document_type": _type})
|
||||||
|
settings.save()
|
||||||
|
|||||||
Reference in New Issue
Block a user