Merge pull request #17448 from nabinhait/woocommerce-multilingual-fix-dev
fix: Multilingual handling in woocommerce integration
This commit is contained in:
commit
bd0d10f82a
@ -186,7 +186,7 @@ def link_item(item_data,item_status):
|
|||||||
item.item_name = str(item_data.get("name"))
|
item.item_name = str(item_data.get("name"))
|
||||||
item.item_code = "woocommerce - " + str(item_data.get("product_id"))
|
item.item_code = "woocommerce - " + str(item_data.get("product_id"))
|
||||||
item.woocommerce_id = 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.stock_uom = woocommerce_settings.uom or _("Nos")
|
||||||
item.save()
|
item.save()
|
||||||
frappe.db.commit()
|
frappe.db.commit()
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
|
|
||||||
from frappe import _
|
from frappe import _
|
||||||
|
from frappe.utils.nestedset import get_root_of
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
from six.moves.urllib.parse import urlparse
|
from six.moves.urllib.parse import urlparse
|
||||||
|
|
||||||
@ -62,10 +62,10 @@ class WoocommerceSettings(Document):
|
|||||||
custom.read_only = 1
|
custom.read_only = 1
|
||||||
custom.save()
|
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 = frappe.new_doc("Item Group")
|
||||||
item_group.item_group_name = "WooCommerce Products"
|
item_group.item_group_name = _("WooCommerce Products")
|
||||||
item_group.parent_item_group = _("All Item Groups")
|
item_group.parent_item_group = get_root_of("Item Group")
|
||||||
item_group.save()
|
item_group.save()
|
||||||
|
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ class WoocommerceSettings(Document):
|
|||||||
for name in email_names:
|
for name in email_names:
|
||||||
frappe.delete_doc("Custom Field",name)
|
frappe.delete_doc("Custom Field",name)
|
||||||
|
|
||||||
frappe.delete_doc("Item Group","WooCommerce Products")
|
frappe.delete_doc("Item Group", _("WooCommerce Products"))
|
||||||
|
|
||||||
frappe.db.commit()
|
frappe.db.commit()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user