This commit is contained in:
hrwx 2019-09-13 17:04:01 +00:00 committed by prssanna
parent c6b7695ab5
commit 5aa8743024
3 changed files with 12 additions and 5 deletions

View File

@ -246,6 +246,7 @@ def update_taxes_with_shipping_lines(taxes, shipping_lines, shopify_settings):
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", \

View File

@ -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 @@ def create_item(shopify_item, warehouse, has_variant=0, attributes=None,variant_
"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 @@ def create_item(shopify_item, warehouse, has_variant=0, attributes=None,variant_
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:

View File

@ -36,8 +36,8 @@ def get_webhook_address(connector_name, method, exclude_uri=False):
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
return server_url