...
This commit is contained in:
@@ -4,7 +4,7 @@ from frappe import _
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def sync_custom_fields_to_woocommerce(item_code):
|
def sync_custom_fields_to_woocommerce(item_code):
|
||||||
"""Sync Custom Fields vom Item nach WooCommerce ACF (dynamisch)"""
|
"""Sync Custom Fields vom Item nach WooCommerce ACF (dynamisch aus DocType)"""
|
||||||
|
|
||||||
if not item_code:
|
if not item_code:
|
||||||
frappe.throw(_("Kein Item Code angegeben"))
|
frappe.throw(_("Kein Item Code angegeben"))
|
||||||
@@ -18,7 +18,7 @@ def sync_custom_fields_to_woocommerce(item_code):
|
|||||||
frappe.msgprint(_("Item hat keine verknüpften WooCommerce Server"), indicator="orange")
|
frappe.msgprint(_("Item hat keine verknüpften WooCommerce Server"), indicator="orange")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Dynamisches Mapping aus DocType laden
|
# Dynamisches Mapping aus DocType "WooCommerce ACF Mapping"
|
||||||
field_mapping = {}
|
field_mapping = {}
|
||||||
mappings = frappe.get_all("WooCommerce ACF Mapping",
|
mappings = frappe.get_all("WooCommerce ACF Mapping",
|
||||||
filters={"enabled": 1},
|
filters={"enabled": 1},
|
||||||
@@ -29,8 +29,7 @@ def sync_custom_fields_to_woocommerce(item_code):
|
|||||||
field_mapping[m.erp_field] = m.acf_field
|
field_mapping[m.erp_field] = m.acf_field
|
||||||
|
|
||||||
if not field_mapping:
|
if not field_mapping:
|
||||||
frappe.msgprint(_("Keine aktivierten Mappings im DocType 'WooCommerce ACF Mapping' gefunden."),
|
frappe.msgprint(_("Keine aktivierten Mappings im DocType 'WooCommerce ACF Mapping' gefunden."), indicator="orange")
|
||||||
indicator="orange")
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
success_count = 0
|
success_count = 0
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
app_name = "erpnext_custom"
|
app_name = "erpnext_custom"
|
||||||
app_title = "NEXTErp Custom"
|
app_title = "NEXTErp Custom"
|
||||||
app_publisher = "Jens Falk"
|
app_publisher = "Jens Falk"
|
||||||
app_description = "Custom Extensions für NEXTErp - WooCommerce ACF Sync"
|
app_description = "Custom Extensions für NEXTErp mit WooCommerce ACF Sync"
|
||||||
app_email = "jens@falk.plus"
|
app_email = "jens@falk.plus"
|
||||||
app_license = "MIT"
|
app_license = "MIT"
|
||||||
|
|
||||||
|
fixtures = []
|
||||||
Reference in New Issue
Block a user