From 294238abfd399fd82c2852766765d4f8ec436e2e Mon Sep 17 00:00:00 2001 From: Shreya Date: Fri, 8 Jun 2018 17:15:30 +0530 Subject: [PATCH] Fix shopify test case --- erpnext/assets/doctype/asset/test_asset.py | 3 +-- .../doctype/shopify_settings/sync_product.py | 18 +++++++++--------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/erpnext/assets/doctype/asset/test_asset.py b/erpnext/assets/doctype/asset/test_asset.py index 32bb8025aac..e3610e1d11a 100644 --- a/erpnext/assets/doctype/asset/test_asset.py +++ b/erpnext/assets/doctype/asset/test_asset.py @@ -22,7 +22,7 @@ class TestAsset(unittest.TestCase): pi = make_purchase_invoice(asset.name, asset.item_code, asset.gross_purchase_amount, asset.company, asset.purchase_date) - + print(pi.name) pi.supplier = "_Test Supplier" pi.insert() pi.submit() @@ -353,7 +353,6 @@ class TestAsset(unittest.TestCase): ''', (asset.name))] if pi: pi_doc = frappe.get_doc("Purchase Invoice", pi[0]) - print(pi[0]) pi_doc.cancel # if pi: # frappe.db.set_value("Purchase Invoice", {"name": pi[0]}, "docstatus", 2) diff --git a/erpnext/erpnext_integrations/doctype/shopify_settings/sync_product.py b/erpnext/erpnext_integrations/doctype/shopify_settings/sync_product.py index 55f47a600e3..ff1edea713a 100644 --- a/erpnext/erpnext_integrations/doctype/shopify_settings/sync_product.py +++ b/erpnext/erpnext_integrations/doctype/shopify_settings/sync_product.py @@ -216,7 +216,7 @@ def get_supplier(shopify_item): "doctype": "Supplier", "supplier_name": shopify_item.get("vendor"), "shopify_supplier_id": shopify_item.get("vendor").lower(), - "supplier_type": get_supplier_type() + "supplier_group": get_supplier_group() }).insert() return supplier.name else: @@ -224,15 +224,15 @@ def get_supplier(shopify_item): else: return "" -def get_supplier_type(): - supplier_type = frappe.db.get_value("Supplier Type", _("Shopify Supplier")) - if not supplier_type: - supplier_type = frappe.get_doc({ - "doctype": "Supplier Type", - "supplier_type": _("Shopify Supplier") +def get_supplier_group(): + supplier_group = frappe.db.get_value("Supplier Group", _("Shopify Supplier")) + if not supplier_group: + supplier_group = frappe.get_doc({ + "doctype": "Supplier Group", + "supplier_group_name": _("Shopify Supplier") }).insert() - return supplier_type.name - return supplier_type + return supplier_group.name + return supplier_group def get_item_details(shopify_item): item_details = {}