From 91baa22d59e5a5786c64372af660e1bd5d0581ec Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 6 Oct 2021 13:37:26 +0530 Subject: [PATCH] fix: remove stale doctypes and add msg for ecommerce refactor (bp #27700) (cherry picked from commit 6d99bb5ce69cbe81ef446e76236f2571d383f8a4) Co-authored-by: Ankush Menat --- erpnext/patches.txt | 1 + .../v13_0/shopping_cart_to_ecommerce.py | 29 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 erpnext/patches/v13_0/shopping_cart_to_ecommerce.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 2f4140ef403..7814fe0f975 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -319,3 +319,4 @@ erpnext.patches.v13_0.create_accounting_dimensions_in_pos_doctypes erpnext.patches.v13_0.create_custom_field_for_finance_book erpnext.patches.v13_0.modify_invalid_gain_loss_gl_entries erpnext.patches.v13_0.fix_additional_cost_in_mfg_stock_entry +erpnext.patches.v13_0.shopping_cart_to_ecommerce diff --git a/erpnext/patches/v13_0/shopping_cart_to_ecommerce.py b/erpnext/patches/v13_0/shopping_cart_to_ecommerce.py new file mode 100644 index 00000000000..d336c929751 --- /dev/null +++ b/erpnext/patches/v13_0/shopping_cart_to_ecommerce.py @@ -0,0 +1,29 @@ +import click +import frappe + + +def execute(): + + frappe.delete_doc("DocType", "Shopping Cart Settings", ignore_missing=True) + frappe.delete_doc("DocType", "Products Settings", ignore_missing=True) + frappe.delete_doc("DocType", "Supplier Item Group", ignore_missing=True) + + if frappe.db.get_single_value("E Commerce Settings", "enabled"): + notify_users() + + +def notify_users(): + + click.secho( + "Shopping cart and Product settings are merged into E-commerce settings.\n" + "Checkout the documentation to learn more:" + "https://docs.erpnext.com/docs/v13/user/manual/en/e_commerce/set_up_e_commerce", + fg="yellow", + ) + + note = frappe.new_doc("Note") + note.title = "New E-Commerce Module" + note.public = 1 + note.notify_on_login = 1 + note.content = """

You are seeing this message because Shopping Cart is enabled on your site.


Shopping Cart Settings and Products settings are now merged into "E Commerce Settings".


You can learn about new and improved E-Commerce features in the official documentation.

  1. https://docs.erpnext.com/docs/v13/user/manual/en/e_commerce/set_up_e_commerce


""" + note.save()