changes
diff --git a/erpnext/erpnext_integrations/connectors/shopify_connection.py b/erpnext/erpnext_integrations/connectors/shopify_connection.py
index 1d6e891..ed53166 100644
--- a/erpnext/erpnext_integrations/connectors/shopify_connection.py
+++ b/erpnext/erpnext_integrations/connectors/shopify_connection.py
@@ -246,6 +246,7 @@
return taxes
def get_tax_account_head(tax):
+ return
tax_title = tax.get("title").encode("utf-8")
tax_account = frappe.db.get_value("Shopify Tax Account", \
diff --git a/erpnext/erpnext_integrations/doctype/shopify_settings/sync_product.py b/erpnext/erpnext_integrations/doctype/shopify_settings/sync_product.py
index 5570e69..bde1011 100644
--- a/erpnext/erpnext_integrations/doctype/shopify_settings/sync_product.py
+++ b/erpnext/erpnext_integrations/doctype/shopify_settings/sync_product.py
@@ -1,13 +1,14 @@
from __future__ import unicode_literals
import frappe
from frappe import _
+from erpnext import get_default_company
from frappe.utils import cstr, cint, get_request_session
from erpnext.erpnext_integrations.doctype.shopify_settings.shopify_settings import get_shopify_url, get_header
shopify_variants_attr_list = ["option1", "option2", "option3"]
def sync_item_from_shopify(shopify_settings, item):
- url = get_shopify_url("/admin/products/{0}.json".format(item.get("product_id")), shopify_settings)
+ url = get_shopify_url("admin/api/2019-04/products/{0}.json".format(item.get("product_id")), shopify_settings)
session = get_request_session()
try:
@@ -107,7 +108,12 @@
"image": get_item_image(shopify_item),
"weight_uom": shopify_item.get("weight_unit"),
"weight_per_unit": shopify_item.get("weight"),
- "default_supplier": get_supplier(shopify_item)
+ "default_supplier": get_supplier(shopify_item),
+ "item_defaults": [
+ {
+ "company": get_default_company()
+ }
+ ]
}
if not is_item_exists(item_dict, attributes, variant_of=variant_of):
@@ -116,7 +122,7 @@
if not item_details:
new_item = frappe.get_doc(item_dict)
- new_item.insert()
+ new_item.insert(ignore_permissions=True, ignore_mandatory=True)
name = new_item.name
if not name:
diff --git a/erpnext/erpnext_integrations/utils.py b/erpnext/erpnext_integrations/utils.py
index 6acb241..84f7f5a 100644
--- a/erpnext/erpnext_integrations/utils.py
+++ b/erpnext/erpnext_integrations/utils.py
@@ -36,8 +36,8 @@
try:
url = frappe.request.url
except RuntimeError:
- url = frappe.utils.get_url()
+ url = "http://localhost:8000"
server_url = '{uri.scheme}://{uri.netloc}/api/method/{endpoint}'.format(uri=urlparse(url), endpoint=endpoint)
- return server_url
\ No newline at end of file
+ return server_url