From 6acc7753f8d3806d4848e3dce2cfb42a59dab864 Mon Sep 17 00:00:00 2001 From: JensFalk Date: Mon, 8 Jun 2026 15:27:31 +0200 Subject: [PATCH] README.md aktualisiert --- README.md | 47 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 65f5f65..8662af7 100644 --- a/README.md +++ b/README.md @@ -18,10 +18,10 @@ bench new-app erpnext_custom Bei den Fragen: -App Title: NEXTErp Custom -App Description: WooCommerce ACF Custom Fields Sync -App Publisher: Jens Falk -App Email: service@falk.plus +- App Title: NEXTErp Custom +- App Description: WooCommerce ACF Custom Fields Sync +- App Publisher: Jens Falk +- App Email: service@falk.plus ```bash cd ~/frappe-bench/apps/erpnext_custom/erpnext_custom @@ -104,3 +104,42 @@ Danach ausführen ```bash bench restart ``` + +### 2. DocType anlegen + +DocType Name: WooCommerce ACF Mapping +**Felder:** + +- erp_field → Data → Pflicht +- acf_field → Data → Pflicht +- enabled → Check → Default = 1 +- description → Small Text + +**Title Field:** erp_field + +### Client Script mit Button +Custom Script → New + +- DocType: Item +- Script Type: Client Script + +```js +frappe.ui.form.on('Item', { + refresh: function(frm) { + frm.add_custom_button('Custom Fields zu WooCommerce syncen', function() { + if (!frm.doc.woocommerce_servers || frm.doc.woocommerce_servers.length === 0) { + frappe.msgprint("Kein WooCommerce Server verknüpft!", "Warnung"); + return; + } + + frappe.call({ + method: 'erpnext_custom.api.sync_custom_fields_to_woocommerce', + args: { item_code: frm.doc.name } + }); + }, "WooCommerce"); + } +}); + +``` + +