Skip to content

Commit

Permalink
test: create_party_link method
Browse files Browse the repository at this point in the history
  • Loading branch information
nextchamp-saqib committed Nov 22, 2021
1 parent d83a763 commit da409eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 2 additions & 0 deletions erpnext/accounts/doctype/party_link/party_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ def create_party_link(primary_role, primary_party, secondary_party):

party_link.save(ignore_permissions=True)

return party_link

9 changes: 2 additions & 7 deletions erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -2316,6 +2316,7 @@ def test_sales_invoice_against_supplier(self):
from erpnext.accounts.doctype.opening_invoice_creation_tool.test_opening_invoice_creation_tool import (
make_customer,
)
from erpnext.accounts.doctype.party_link.party_link import create_party_link
from erpnext.buying.doctype.supplier.test_supplier import create_supplier

# create a customer
Expand All @@ -2324,13 +2325,7 @@ def test_sales_invoice_against_supplier(self):
supplier = create_supplier(supplier_name="_Test Common Supplier").name

# create a party link between customer & supplier
# set primary role as supplier
party_link = frappe.new_doc("Party Link")
party_link.primary_role = "Supplier"
party_link.primary_party = supplier
party_link.secondary_role = "Customer"
party_link.secondary_party = customer
party_link.save()
party_link = create_party_link("Supplier", supplier, customer)

# enable common party accounting
frappe.db.set_value('Accounts Settings', None, 'enable_common_party_accounting', 1)
Expand Down

0 comments on commit da409eb

Please sign in to comment.