fix: missing attribute error

This commit is contained in:
Devin Slauenwhite 2023-06-07 15:55:16 -04:00
parent f68ab3dfff
commit 7973951c37

View File

@ -166,7 +166,9 @@ class TestPaymentReconciliation(FrappeTestCase):
def create_payment_reconciliation(self):
pr = frappe.new_doc("Payment Reconciliation")
pr.company = self.company
pr.party_type = self.party_type or "Customer"
pr.party_type = (
self.party_type if hasattr(self, "party_type") and self.party_type else "Customer"
)
pr.party = self.customer
pr.receivable_payable_account = get_party_account(pr.party_type, pr.party, pr.company)
pr.from_invoice_date = pr.to_invoice_date = pr.from_payment_date = pr.to_payment_date = nowdate()