diff --git a/erpnext/erpnext_integrations/connectors/woocommerce_connection.py b/erpnext/erpnext_integrations/connectors/woocommerce_connection.py index 46386e4572..4700202213 100644 --- a/erpnext/erpnext_integrations/connectors/woocommerce_connection.py +++ b/erpnext/erpnext_integrations/connectors/woocommerce_connection.py @@ -186,7 +186,7 @@ def link_item(item_data,item_status): item.item_name = str(item_data.get("name")) item.item_code = "woocommerce - " + str(item_data.get("product_id")) item.woocommerce_id = str(item_data.get("product_id")) - item.item_group = "WooCommerce Products" + item.item_group = _("WooCommerce Products") item.stock_uom = woocommerce_settings.uom or _("Nos") item.save() frappe.db.commit() diff --git a/erpnext/erpnext_integrations/doctype/woocommerce_settings/woocommerce_settings.py b/erpnext/erpnext_integrations/doctype/woocommerce_settings/woocommerce_settings.py index 7dc93c285f..055684d445 100644 --- a/erpnext/erpnext_integrations/doctype/woocommerce_settings/woocommerce_settings.py +++ b/erpnext/erpnext_integrations/doctype/woocommerce_settings/woocommerce_settings.py @@ -4,8 +4,8 @@ from __future__ import unicode_literals import frappe - from frappe import _ +from frappe.utils.nestedset import get_root_of from frappe.model.document import Document from six.moves.urllib.parse import urlparse @@ -62,10 +62,10 @@ class WoocommerceSettings(Document): custom.read_only = 1 custom.save() - if not frappe.get_value("Item Group",{"name": "WooCommerce Products"}): + if not frappe.get_value("Item Group",{"name": _("WooCommerce Products")}): item_group = frappe.new_doc("Item Group") - item_group.item_group_name = "WooCommerce Products" - item_group.parent_item_group = _("All Item Groups") + item_group.item_group_name = _("WooCommerce Products") + item_group.parent_item_group = get_root_of("Item Group") item_group.save() @@ -83,7 +83,7 @@ class WoocommerceSettings(Document): for name in email_names: frappe.delete_doc("Custom Field",name) - frappe.delete_doc("Item Group","WooCommerce Products") + frappe.delete_doc("Item Group", _("WooCommerce Products")) frappe.db.commit()