changes
This commit is contained in:
parent
c6b7695ab5
commit
5aa8743024
@ -246,6 +246,7 @@ def update_taxes_with_shipping_lines(taxes, shipping_lines, shopify_settings):
|
|||||||
return taxes
|
return taxes
|
||||||
|
|
||||||
def get_tax_account_head(tax):
|
def get_tax_account_head(tax):
|
||||||
|
return
|
||||||
tax_title = tax.get("title").encode("utf-8")
|
tax_title = tax.get("title").encode("utf-8")
|
||||||
|
|
||||||
tax_account = frappe.db.get_value("Shopify Tax Account", \
|
tax_account = frappe.db.get_value("Shopify Tax Account", \
|
||||||
|
|||||||
@ -1,13 +1,14 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
from frappe import _
|
from frappe import _
|
||||||
|
from erpnext import get_default_company
|
||||||
from frappe.utils import cstr, cint, get_request_session
|
from frappe.utils import cstr, cint, get_request_session
|
||||||
from erpnext.erpnext_integrations.doctype.shopify_settings.shopify_settings import get_shopify_url, get_header
|
from erpnext.erpnext_integrations.doctype.shopify_settings.shopify_settings import get_shopify_url, get_header
|
||||||
|
|
||||||
shopify_variants_attr_list = ["option1", "option2", "option3"]
|
shopify_variants_attr_list = ["option1", "option2", "option3"]
|
||||||
|
|
||||||
def sync_item_from_shopify(shopify_settings, item):
|
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()
|
session = get_request_session()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -107,7 +108,12 @@ def create_item(shopify_item, warehouse, has_variant=0, attributes=None,variant_
|
|||||||
"image": get_item_image(shopify_item),
|
"image": get_item_image(shopify_item),
|
||||||
"weight_uom": shopify_item.get("weight_unit"),
|
"weight_uom": shopify_item.get("weight_unit"),
|
||||||
"weight_per_unit": shopify_item.get("weight"),
|
"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):
|
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:
|
if not item_details:
|
||||||
new_item = frappe.get_doc(item_dict)
|
new_item = frappe.get_doc(item_dict)
|
||||||
new_item.insert()
|
new_item.insert(ignore_permissions=True, ignore_mandatory=True)
|
||||||
name = new_item.name
|
name = new_item.name
|
||||||
|
|
||||||
if not name:
|
if not name:
|
||||||
|
|||||||
@ -36,7 +36,7 @@ def get_webhook_address(connector_name, method, exclude_uri=False):
|
|||||||
try:
|
try:
|
||||||
url = frappe.request.url
|
url = frappe.request.url
|
||||||
except RuntimeError:
|
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)
|
server_url = '{uri.scheme}://{uri.netloc}/api/method/{endpoint}'.format(uri=urlparse(url), endpoint=endpoint)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user