fix: Multilingual handling in woocommerce integration

This commit is contained in:
Nabin Hait 2019-05-01 19:17:59 +05:30
parent 0af45b41d7
commit 240008d7c6
2 changed files with 6 additions and 6 deletions

View File

@ -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()

View File

@ -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()