diff --git a/erpnext/accounts/doctype/payment_order/payment_order.js b/erpnext/accounts/doctype/payment_order/payment_order.js
index aa373bc2fc..9074defa57 100644
--- a/erpnext/accounts/doctype/payment_order/payment_order.js
+++ b/erpnext/accounts/doctype/payment_order/payment_order.js
@@ -10,6 +10,9 @@ frappe.ui.form.on('Payment Order', {
}
}
});
+
+ frm.set_df_property('references', 'cannot_add_rows', true);
+ frm.set_df_property('references', 'cannot_delete_rows', true);
},
refresh: function(frm) {
if (frm.doc.docstatus == 0) {
diff --git a/erpnext/accounts/doctype/pos_settings/pos_settings.js b/erpnext/accounts/doctype/pos_settings/pos_settings.js
index 9003af56a5..7d8f3562c8 100644
--- a/erpnext/accounts/doctype/pos_settings/pos_settings.js
+++ b/erpnext/accounts/doctype/pos_settings/pos_settings.js
@@ -2,11 +2,11 @@
// For license information, please see license.txt
let search_fields_datatypes = ['Data', 'Link', 'Dynamic Link', 'Long Text', 'Select', 'Small Text', 'Text', 'Text Editor'];
-let do_not_include_fields = ["naming_series", "item_code", "item_name", "stock_uom", "hub_sync_id", "asset_naming_series",
+let do_not_include_fields = ["naming_series", "item_code", "item_name", "stock_uom", "asset_naming_series",
"default_material_request_type", "valuation_method", "warranty_period", "weight_uom", "batch_number_series",
"serial_no_series", "purchase_uom", "customs_tariff_number", "sales_uom", "deferred_revenue_account",
"deferred_expense_account", "quality_inspection_template", "route", "slideshow", "website_image_alt", "thumbnail",
- "web_long_description", "hub_sync_id"]
+ "web_long_description"]
frappe.ui.form.on('POS Settings', {
onload: function(frm) {
diff --git a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py
index c36f3cb201..508c7af8fa 100644
--- a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py
+++ b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py
@@ -174,6 +174,7 @@ def get_lower_deduction_certificate(tax_details, pan_no):
ldc_name = frappe.db.get_value('Lower Deduction Certificate',
{
'pan_no': pan_no,
+ 'tax_withholding_category': tax_details.tax_withholding_category,
'valid_from': ('>=', tax_details.from_date),
'valid_upto': ('<=', tax_details.to_date)
}, 'name')
diff --git a/erpnext/hub/__init__.py b/erpnext/accounts/print_format_field_template/__init__.py
similarity index 100%
rename from erpnext/hub/__init__.py
rename to erpnext/accounts/print_format_field_template/__init__.py
diff --git a/erpnext/hub_node/doctype/__init__.py b/erpnext/accounts/print_format_field_template/purchase_invoice_taxes/__init__.py
similarity index 100%
rename from erpnext/hub_node/doctype/__init__.py
rename to erpnext/accounts/print_format_field_template/purchase_invoice_taxes/__init__.py
diff --git a/erpnext/accounts/print_format_field_template/purchase_invoice_taxes/purchase_invoice_taxes.json b/erpnext/accounts/print_format_field_template/purchase_invoice_taxes/purchase_invoice_taxes.json
new file mode 100644
index 0000000000..f525f7b8d4
--- /dev/null
+++ b/erpnext/accounts/print_format_field_template/purchase_invoice_taxes/purchase_invoice_taxes.json
@@ -0,0 +1,16 @@
+{
+ "creation": "2021-10-19 18:06:53.083133",
+ "docstatus": 0,
+ "doctype": "Print Format Field Template",
+ "document_type": "Purchase Invoice",
+ "field": "taxes",
+ "idx": 0,
+ "modified": "2021-10-19 18:06:53.083133",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Purchase Invoice Taxes",
+ "owner": "Administrator",
+ "standard": 1,
+ "template": "",
+ "template_file": "templates/print_formats/includes/taxes_and_charges.html"
+}
\ No newline at end of file
diff --git a/erpnext/hub_node/doctype/hub_tracked_item/__init__.py b/erpnext/accounts/print_format_field_template/sales_invoice_taxes/__init__.py
similarity index 100%
rename from erpnext/hub_node/doctype/hub_tracked_item/__init__.py
rename to erpnext/accounts/print_format_field_template/sales_invoice_taxes/__init__.py
diff --git a/erpnext/accounts/print_format_field_template/sales_invoice_taxes/sales_invoice_taxes.json b/erpnext/accounts/print_format_field_template/sales_invoice_taxes/sales_invoice_taxes.json
new file mode 100644
index 0000000000..8ce62a8b26
--- /dev/null
+++ b/erpnext/accounts/print_format_field_template/sales_invoice_taxes/sales_invoice_taxes.json
@@ -0,0 +1,16 @@
+{
+ "creation": "2021-10-19 17:50:00.152759",
+ "docstatus": 0,
+ "doctype": "Print Format Field Template",
+ "document_type": "Sales Invoice",
+ "field": "taxes",
+ "idx": 0,
+ "modified": "2021-10-19 18:13:20.894207",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Sales Invoice Taxes",
+ "owner": "Administrator",
+ "standard": 1,
+ "template": "",
+ "template_file": "templates/print_formats/includes/taxes_and_charges.html"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py
index 0094bc2eeb..31416da4ac 100644
--- a/erpnext/accounts/report/general_ledger/general_ledger.py
+++ b/erpnext/accounts/report/general_ledger/general_ledger.py
@@ -155,6 +155,8 @@ def get_gl_entries(filters, accounting_dimensions):
if filters.get("group_by") == "Group by Voucher":
order_by_statement = "order by posting_date, voucher_type, voucher_no"
+ if filters.get("group_by") == "Group by Account":
+ order_by_statement = "order by account, posting_date, creation"
if filters.get("include_default_book_entries"):
filters['company_fb'] = frappe.db.get_value("Company",
diff --git a/erpnext/hub_node/doctype/hub_user/__init__.py b/erpnext/buying/print_format_field_template/__init__.py
similarity index 100%
rename from erpnext/hub_node/doctype/hub_user/__init__.py
rename to erpnext/buying/print_format_field_template/__init__.py
diff --git a/erpnext/hub_node/doctype/hub_users/__init__.py b/erpnext/buying/print_format_field_template/purchase_order_taxes/__init__.py
similarity index 100%
rename from erpnext/hub_node/doctype/hub_users/__init__.py
rename to erpnext/buying/print_format_field_template/purchase_order_taxes/__init__.py
diff --git a/erpnext/buying/print_format_field_template/purchase_order_taxes/purchase_order_taxes.json b/erpnext/buying/print_format_field_template/purchase_order_taxes/purchase_order_taxes.json
new file mode 100644
index 0000000000..73b7730894
--- /dev/null
+++ b/erpnext/buying/print_format_field_template/purchase_order_taxes/purchase_order_taxes.json
@@ -0,0 +1,16 @@
+{
+ "creation": "2021-10-19 18:07:19.253457",
+ "docstatus": 0,
+ "doctype": "Print Format Field Template",
+ "document_type": "Purchase Order",
+ "field": "taxes",
+ "idx": 0,
+ "modified": "2021-10-19 18:07:19.253457",
+ "modified_by": "Administrator",
+ "module": "Buying",
+ "name": "Purchase Order Taxes",
+ "owner": "Administrator",
+ "standard": 1,
+ "template": "",
+ "template_file": "templates/print_formats/includes/taxes_and_charges.html"
+}
\ No newline at end of file
diff --git a/erpnext/hub_node/doctype/marketplace_settings/__init__.py b/erpnext/buying/print_format_field_template/supplier_quotation_taxes/__init__.py
similarity index 100%
rename from erpnext/hub_node/doctype/marketplace_settings/__init__.py
rename to erpnext/buying/print_format_field_template/supplier_quotation_taxes/__init__.py
diff --git a/erpnext/buying/print_format_field_template/supplier_quotation_taxes/supplier_quotation_taxes.json b/erpnext/buying/print_format_field_template/supplier_quotation_taxes/supplier_quotation_taxes.json
new file mode 100644
index 0000000000..2be17a1b01
--- /dev/null
+++ b/erpnext/buying/print_format_field_template/supplier_quotation_taxes/supplier_quotation_taxes.json
@@ -0,0 +1,16 @@
+{
+ "creation": "2021-10-19 18:09:08.103919",
+ "docstatus": 0,
+ "doctype": "Print Format Field Template",
+ "document_type": "Supplier Quotation",
+ "field": "taxes",
+ "idx": 0,
+ "modified": "2021-10-19 18:09:08.103919",
+ "modified_by": "Administrator",
+ "module": "Buying",
+ "name": "Supplier Quotation Taxes",
+ "owner": "Administrator",
+ "standard": 1,
+ "template": "",
+ "template_file": "templates/print_formats/includes/taxes_and_charges.html"
+}
\ No newline at end of file
diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py
index 7b4566a2fa..eeb659dee5 100644
--- a/erpnext/controllers/queries.py
+++ b/erpnext/controllers/queries.py
@@ -132,7 +132,8 @@ def supplier_query(doctype, txt, searchfield, start, page_len, filters):
return frappe.db.sql("""select {field} from `tabSupplier`
where docstatus < 2
and ({key} like %(txt)s
- or supplier_name like %(txt)s) and disabled=0
+ or supplier_name like %(txt)s) and disabled=0
+ and (on_hold = 0 or (on_hold = 1 and CURDATE() > release_date))
{mcond}
order by
if(locate(%(_txt)s, name), locate(%(_txt)s, name), 99999),
diff --git a/erpnext/crm/doctype/opportunity/opportunity.py b/erpnext/crm/doctype/opportunity/opportunity.py
index 55e0efaab1..0e469ac642 100644
--- a/erpnext/crm/doctype/opportunity/opportunity.py
+++ b/erpnext/crm/doctype/opportunity/opportunity.py
@@ -314,6 +314,8 @@ def make_request_for_quotation(source_name, target_doc=None):
@frappe.whitelist()
def make_customer(source_name, target_doc=None):
def set_missing_values(source, target):
+ target.opportunity_name = source.name
+
if source.opportunity_from == "Lead":
target.lead_name = source.party_name
diff --git a/erpnext/demo/data/drug_list.json b/erpnext/demo/data/drug_list.json
index e91c30d199..3069042843 100644
--- a/erpnext/demo/data/drug_list.json
+++ b/erpnext/demo/data/drug_list.json
@@ -60,7 +60,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -144,7 +143,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -226,7 +224,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -308,7 +305,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -390,7 +386,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -472,7 +467,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -554,7 +548,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -636,7 +629,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -718,7 +710,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -800,7 +791,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -882,7 +872,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -964,7 +953,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -1046,7 +1034,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -1128,7 +1115,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -1210,7 +1196,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -1292,7 +1277,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -1374,7 +1358,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -1456,7 +1439,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -1538,7 +1520,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -1620,7 +1601,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -1702,7 +1682,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -1784,7 +1763,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -1866,7 +1844,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -1948,7 +1925,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -2030,7 +2006,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -2112,7 +2087,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -2194,7 +2168,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -2276,7 +2249,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -2358,7 +2330,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -2440,7 +2411,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -2522,7 +2492,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -2604,7 +2573,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -2686,7 +2654,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -2768,7 +2735,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -2850,7 +2816,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -2932,7 +2897,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -3014,7 +2978,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -3098,7 +3061,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -3180,7 +3142,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -3262,7 +3223,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -3344,7 +3304,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -3426,7 +3385,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -3508,7 +3466,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -3590,7 +3547,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -3672,7 +3628,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -3754,7 +3709,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -3836,7 +3790,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -3918,7 +3871,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -4000,7 +3952,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -4082,7 +4033,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -4164,7 +4114,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -4246,7 +4195,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -4328,7 +4276,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -4410,7 +4357,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -4492,7 +4438,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -4574,7 +4519,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -4656,7 +4600,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -4738,7 +4681,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -4820,7 +4762,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -4902,7 +4843,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -4984,7 +4924,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -5066,7 +5005,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
@@ -5148,7 +5086,6 @@
"standard_rate": 0.0,
"stock_uom": "Nos",
"supplier_items": [],
- "synced_with_hub": 0,
"taxes": [],
"thumbnail": null,
"tolerance": 0.0,
diff --git a/erpnext/hub_node/__init__.py b/erpnext/hub_node/__init__.py
deleted file mode 100644
index 6ac3255c12..0000000000
--- a/erpnext/hub_node/__init__.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and contributors
-# For license information, please see license.txt
-
-from __future__ import unicode_literals
-
-import frappe
-
-
-@frappe.whitelist()
-def enable_hub():
- hub_settings = frappe.get_doc('Marketplace Settings')
- hub_settings.register()
- frappe.db.commit()
- return hub_settings
-
-@frappe.whitelist()
-def sync():
- hub_settings = frappe.get_doc('Marketplace Settings')
- hub_settings.sync()
diff --git a/erpnext/hub_node/api.py b/erpnext/hub_node/api.py
deleted file mode 100644
index 5530491775..0000000000
--- a/erpnext/hub_node/api.py
+++ /dev/null
@@ -1,233 +0,0 @@
-from __future__ import unicode_literals
-
-import json
-
-import frappe
-from frappe import _
-from frappe.desk.form.load import get_attachments
-from frappe.frappeclient import FrappeClient
-from six import string_types
-
-current_user = frappe.session.user
-
-
-@frappe.whitelist()
-def register_marketplace(company, company_description):
- validate_registerer()
-
- settings = frappe.get_single('Marketplace Settings')
- message = settings.register_seller(company, company_description)
-
- if message.get('hub_seller_name'):
- settings.registered = 1
- settings.hub_seller_name = message.get('hub_seller_name')
- settings.save()
-
- settings.add_hub_user(frappe.session.user)
-
- return { 'ok': 1 }
-
-
-@frappe.whitelist()
-def register_users(user_list):
- user_list = json.loads(user_list)
-
- settings = frappe.get_single('Marketplace Settings')
-
- for user in user_list:
- settings.add_hub_user(user)
-
- return user_list
-
-
-def validate_registerer():
- if current_user == 'Administrator':
- frappe.throw(_('Please login as another user to register on Marketplace'))
-
- valid_roles = ['System Manager', 'Item Manager']
-
- if not frappe.utils.is_subset(valid_roles, frappe.get_roles()):
- frappe.throw(_('Only users with {0} role can register on Marketplace').format(', '.join(valid_roles)),
- frappe.PermissionError)
-
-
-@frappe.whitelist()
-def call_hub_method(method, params=None):
- connection = get_hub_connection()
-
- if isinstance(params, string_types):
- params = json.loads(params)
-
- params.update({
- 'cmd': 'hub.hub.api.' + method
- })
-
- response = connection.post_request(params)
- return response
-
-
-def map_fields(items):
- field_mappings = get_field_mappings()
- table_fields = [d.fieldname for d in frappe.get_meta('Item').get_table_fields()]
-
- hub_seller_name = frappe.db.get_value('Marketplace Settings', 'Marketplace Settings', 'hub_seller_name')
-
- for item in items:
- for fieldname in table_fields:
- item.pop(fieldname, None)
-
- for mapping in field_mappings:
- local_fieldname = mapping.get('local_fieldname')
- remote_fieldname = mapping.get('remote_fieldname')
-
- value = item.get(local_fieldname)
- item.pop(local_fieldname, None)
- item[remote_fieldname] = value
-
- item['doctype'] = 'Hub Item'
- item['hub_seller'] = hub_seller_name
- item.pop('attachments', None)
-
- return items
-
-
-@frappe.whitelist()
-def get_valid_items(search_value=''):
- items = frappe.get_list(
- 'Item',
- fields=["*"],
- filters={
- 'disabled': 0,
- 'item_name': ['like', '%' + search_value + '%'],
- 'publish_in_hub': 0
- },
- order_by="modified desc"
- )
-
- valid_items = filter(lambda x: x.image and x.description, items)
-
- def prepare_item(item):
- item.source_type = "local"
- item.attachments = get_attachments('Item', item.item_code)
- return item
-
- valid_items = map(prepare_item, valid_items)
-
- return valid_items
-
-@frappe.whitelist()
-def update_item(ref_doc, data):
- data = json.loads(data)
-
- data.update(dict(doctype='Hub Item', name=ref_doc))
- try:
- connection = get_hub_connection()
- connection.update(data)
- except Exception as e:
- frappe.log_error(message=e, title='Hub Sync Error')
-
-@frappe.whitelist()
-def publish_selected_items(items_to_publish):
- items_to_publish = json.loads(items_to_publish)
- items_to_update = []
- if not len(items_to_publish):
- frappe.throw(_('No items to publish'))
-
- for item in items_to_publish:
- item_code = item.get('item_code')
- frappe.db.set_value('Item', item_code, 'publish_in_hub', 1)
-
- hub_dict = {
- 'doctype': 'Hub Tracked Item',
- 'item_code': item_code,
- 'published': 1,
- 'hub_category': item.get('hub_category'),
- 'image_list': item.get('image_list')
- }
- frappe.get_doc(hub_dict).insert(ignore_if_duplicate=True)
-
- items = map_fields(items_to_publish)
-
- try:
- item_sync_preprocess(len(items))
- convert_relative_image_urls_to_absolute(items)
-
- # TODO: Publish Progress
- connection = get_hub_connection()
- connection.insert_many(items)
-
- item_sync_postprocess()
- except Exception as e:
- frappe.log_error(message=e, title='Hub Sync Error')
-
-@frappe.whitelist()
-def unpublish_item(item_code, hub_item_name):
- ''' Remove item listing from the marketplace '''
-
- response = call_hub_method('unpublish_item', {
- 'hub_item_name': hub_item_name
- })
-
- if response:
- frappe.db.set_value('Item', item_code, 'publish_in_hub', 0)
- frappe.delete_doc('Hub Tracked Item', item_code)
- else:
- frappe.throw(_('Unable to update remote activity'))
-
-@frappe.whitelist()
-def get_unregistered_users():
- settings = frappe.get_single('Marketplace Settings')
- registered_users = [user.user for user in settings.users] + ['Administrator', 'Guest']
- all_users = [user.name for user in frappe.db.get_all('User', filters={'enabled': 1})]
- unregistered_users = [user for user in all_users if user not in registered_users]
- return unregistered_users
-
-
-def item_sync_preprocess(intended_item_publish_count):
- response = call_hub_method('pre_items_publish', {
- 'intended_item_publish_count': intended_item_publish_count
- })
-
- if response:
- frappe.db.set_value("Marketplace Settings", "Marketplace Settings", "sync_in_progress", 1)
- return response
- else:
- frappe.throw(_('Unable to update remote activity'))
-
-
-def item_sync_postprocess():
- response = call_hub_method('post_items_publish', {})
- if response:
- frappe.db.set_value('Marketplace Settings', 'Marketplace Settings', 'last_sync_datetime', frappe.utils.now())
- else:
- frappe.throw(_('Unable to update remote activity'))
-
- frappe.db.set_value('Marketplace Settings', 'Marketplace Settings', 'sync_in_progress', 0)
-
-
-def convert_relative_image_urls_to_absolute(items):
- from six.moves.urllib.parse import urljoin
-
- for item in items:
- file_path = item['image']
-
- if file_path.startswith('/files/'):
- item['image'] = urljoin(frappe.utils.get_url(), file_path)
-
-
-def get_hub_connection():
- settings = frappe.get_single('Marketplace Settings')
- marketplace_url = settings.marketplace_url
- hub_user = settings.get_hub_user(frappe.session.user)
-
- if hub_user:
- password = hub_user.get_password()
- hub_connection = FrappeClient(marketplace_url, hub_user.user, password)
- return hub_connection
- else:
- read_only_hub_connection = FrappeClient(marketplace_url)
- return read_only_hub_connection
-
-
-def get_field_mappings():
- return []
diff --git a/erpnext/hub_node/data_migration_mapping/company_to_hub_company/company_to_hub_company.json b/erpnext/hub_node/data_migration_mapping/company_to_hub_company/company_to_hub_company.json
deleted file mode 100644
index b1e421dada..0000000000
--- a/erpnext/hub_node/data_migration_mapping/company_to_hub_company/company_to_hub_company.json
+++ /dev/null
@@ -1,50 +0,0 @@
-{
- "condition": "{'name': ('=', frappe.db.get_single_value('Hub Settings', 'company'))}",
- "creation": "2017-09-07 11:38:43.169065",
- "docstatus": 0,
- "doctype": "Data Migration Mapping",
- "fields": [
- {
- "is_child_table": 0,
- "local_fieldname": "name",
- "remote_fieldname": "company_name"
- },
- {
- "is_child_table": 0,
- "local_fieldname": "country",
- "remote_fieldname": "country"
- },
- {
- "is_child_table": 0,
- "local_fieldname": "\"city\"",
- "remote_fieldname": "seller_city"
- },
- {
- "is_child_table": 0,
- "local_fieldname": "eval:frappe.local.site",
- "remote_fieldname": "site_name"
- },
- {
- "is_child_table": 0,
- "local_fieldname": "eval:frappe.session.user",
- "remote_fieldname": "user"
- },
- {
- "is_child_table": 0,
- "local_fieldname": "company_logo",
- "remote_fieldname": "company_logo"
- }
- ],
- "idx": 2,
- "local_doctype": "Company",
- "mapping_name": "Company to Hub Company",
- "mapping_type": "Push",
- "migration_id_field": "hub_sync_id",
- "modified": "2020-09-18 17:26:09.703215",
- "modified_by": "Administrator",
- "name": "Company to Hub Company",
- "owner": "Administrator",
- "page_length": 10,
- "remote_objectname": "Hub Company",
- "remote_primary_key": "name"
-}
\ No newline at end of file
diff --git a/erpnext/hub_node/data_migration_mapping/hub_message_to_lead/hub_message_to_lead.json b/erpnext/hub_node/data_migration_mapping/hub_message_to_lead/hub_message_to_lead.json
deleted file mode 100644
index d11abeb4b3..0000000000
--- a/erpnext/hub_node/data_migration_mapping/hub_message_to_lead/hub_message_to_lead.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "condition": "{'reference_doctype': 'Lead', 'user': frappe.db.get_single_value('Hub Settings', 'user'), 'status': 'Pending'}",
- "creation": "2017-09-20 15:06:40.279930",
- "docstatus": 0,
- "doctype": "Data Migration Mapping",
- "fields": [
- {
- "is_child_table": 0,
- "local_fieldname": "email_id",
- "remote_fieldname": "email_id"
- },
- {
- "is_child_table": 0,
- "local_fieldname": "lead_name",
- "remote_fieldname": "lead_name"
- }
- ],
- "idx": 0,
- "local_doctype": "Lead",
- "local_primary_key": "email_id",
- "mapping_name": "Hub Message to Lead",
- "mapping_type": "Pull",
- "migration_id_field": "hub_sync_id",
- "modified": "2020-09-18 17:26:09.703215",
- "modified_by": "Administrator",
- "name": "Hub Message to Lead",
- "owner": "Administrator",
- "page_length": 10,
- "remote_objectname": "Hub Message",
- "remote_primary_key": "name"
-}
\ No newline at end of file
diff --git a/erpnext/hub_node/data_migration_mapping/item_to_hub_item/item_to_hub_item.json b/erpnext/hub_node/data_migration_mapping/item_to_hub_item/item_to_hub_item.json
deleted file mode 100644
index bcece69b38..0000000000
--- a/erpnext/hub_node/data_migration_mapping/item_to_hub_item/item_to_hub_item.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
- "condition": "{\"publish_in_hub\": 1}",
- "creation": "2017-09-07 13:27:52.726350",
- "docstatus": 0,
- "doctype": "Data Migration Mapping",
- "fields": [
- {
- "is_child_table": 0,
- "local_fieldname": "item_code",
- "remote_fieldname": "item_code"
- },
- {
- "is_child_table": 0,
- "local_fieldname": "item_name",
- "remote_fieldname": "item_name"
- },
- {
- "is_child_table": 0,
- "local_fieldname": "eval:frappe.db.get_value('Hub Settings' , 'Hub Settings', 'company_email')",
- "remote_fieldname": "hub_seller"
- },
- {
- "is_child_table": 0,
- "local_fieldname": "image",
- "remote_fieldname": "image"
- },
- {
- "is_child_table": 0,
- "local_fieldname": "image_list",
- "remote_fieldname": "image_list"
- },
- {
- "is_child_table": 0,
- "local_fieldname": "item_group",
- "remote_fieldname": "item_group"
- },
- {
- "is_child_table": 0,
- "local_fieldname": "hub_category",
- "remote_fieldname": "hub_category"
- }
- ],
- "idx": 1,
- "local_doctype": "Item",
- "mapping_name": "Item to Hub Item",
- "mapping_type": "Push",
- "migration_id_field": "hub_sync_id",
- "modified": "2018-08-19 22:20:25.727581",
- "modified_by": "Administrator",
- "name": "Item to Hub Item",
- "owner": "Administrator",
- "page_length": 10,
- "remote_objectname": "Hub Item",
- "remote_primary_key": "item_code"
-}
\ No newline at end of file
diff --git a/erpnext/hub_node/data_migration_plan/hub_sync/hub_sync.json b/erpnext/hub_node/data_migration_plan/hub_sync/hub_sync.json
deleted file mode 100644
index e90b1dd1e8..0000000000
--- a/erpnext/hub_node/data_migration_plan/hub_sync/hub_sync.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "creation": "2017-09-07 11:39:38.445902",
- "docstatus": 0,
- "doctype": "Data Migration Plan",
- "idx": 1,
- "mappings": [
- {
- "enabled": 1,
- "mapping": "Item to Hub Item"
- }
- ],
- "modified": "2018-08-19 22:20:25.644602",
- "modified_by": "Administrator",
- "module": "Hub Node",
- "name": "Hub Sync",
- "owner": "Administrator",
- "plan_name": "Hub Sync",
- "postprocess_method": "erpnext.hub_node.api.item_sync_postprocess"
-}
\ No newline at end of file
diff --git a/erpnext/hub_node/doctype/hub_tracked_item/hub_tracked_item.js b/erpnext/hub_node/doctype/hub_tracked_item/hub_tracked_item.js
deleted file mode 100644
index 660532d13d..0000000000
--- a/erpnext/hub_node/doctype/hub_tracked_item/hub_tracked_item.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
-// For license information, please see license.txt
-
-frappe.ui.form.on('Hub Tracked Item', {
- refresh: function(frm) {
-
- }
-});
diff --git a/erpnext/hub_node/doctype/hub_tracked_item/hub_tracked_item.json b/erpnext/hub_node/doctype/hub_tracked_item/hub_tracked_item.json
deleted file mode 100644
index 7d07ba4093..0000000000
--- a/erpnext/hub_node/doctype/hub_tracked_item/hub_tracked_item.json
+++ /dev/null
@@ -1,210 +0,0 @@
-{
- "allow_copy": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "autoname": "field:item_code",
- "beta": 0,
- "creation": "2018-03-18 09:33:50.267762",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
- "fields": [
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "item_code",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Item Code",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 1
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "hub_category",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Hub Category",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "published",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Published",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "image_list",
- "fieldtype": "Long Text",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Image List",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- }
- ],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 0,
- "idx": 0,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 0,
- "max_attachments": 0,
- "modified": "2019-12-10 11:37:35.951019",
- "modified_by": "Administrator",
- "module": "Hub Node",
- "name": "Hub Tracked Item",
- "name_case": "",
- "owner": "Administrator",
- "permissions": [
- {
- "amend": 0,
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 1,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "System Manager",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 0,
- "write": 1
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 1,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Item Manager",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 0,
- "write": 1
- }
- ],
- "quick_entry": 1,
- "read_only": 1,
- "read_only_onload": 0,
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 1,
- "track_seen": 0,
- "track_views": 0
-}
\ No newline at end of file
diff --git a/erpnext/hub_node/doctype/hub_tracked_item/hub_tracked_item.py b/erpnext/hub_node/doctype/hub_tracked_item/hub_tracked_item.py
deleted file mode 100644
index 823c79eb72..0000000000
--- a/erpnext/hub_node/doctype/hub_tracked_item/hub_tracked_item.py
+++ /dev/null
@@ -1,11 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
-# For license information, please see license.txt
-
-from __future__ import unicode_literals
-
-from frappe.model.document import Document
-
-
-class HubTrackedItem(Document):
- pass
diff --git a/erpnext/hub_node/doctype/hub_tracked_item/test_hub_tracked_item.py b/erpnext/hub_node/doctype/hub_tracked_item/test_hub_tracked_item.py
deleted file mode 100644
index c403f902a2..0000000000
--- a/erpnext/hub_node/doctype/hub_tracked_item/test_hub_tracked_item.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
-# See license.txt
-from __future__ import unicode_literals
-
-import unittest
-
-
-class TestHubTrackedItem(unittest.TestCase):
- pass
diff --git a/erpnext/hub_node/doctype/hub_user/hub_user.json b/erpnext/hub_node/doctype/hub_user/hub_user.json
deleted file mode 100644
index f51ffb4387..0000000000
--- a/erpnext/hub_node/doctype/hub_user/hub_user.json
+++ /dev/null
@@ -1,140 +0,0 @@
-{
- "allow_copy": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "autoname": "",
- "beta": 0,
- "creation": "2018-08-31 12:36:45.627531",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
- "fields": [
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "user",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "User",
- "length": 0,
- "no_copy": 0,
- "options": "User",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 1
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "hub_user_name",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Hub User",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "password",
- "fieldtype": "Password",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Hub Password",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- }
- ],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 0,
- "idx": 0,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 1,
- "max_attachments": 0,
- "modified": "2020-09-18 17:26:09.703215",
- "modified_by": "Administrator",
- "module": "Hub Node",
- "name": "Hub User",
- "name_case": "",
- "owner": "Administrator",
- "permissions": [],
- "quick_entry": 1,
- "read_only": 0,
- "read_only_onload": 0,
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 1,
- "track_seen": 0,
- "track_views": 0
-}
\ No newline at end of file
diff --git a/erpnext/hub_node/doctype/hub_user/hub_user.py b/erpnext/hub_node/doctype/hub_user/hub_user.py
deleted file mode 100644
index 1f7c8fc3f2..0000000000
--- a/erpnext/hub_node/doctype/hub_user/hub_user.py
+++ /dev/null
@@ -1,11 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
-# For license information, please see license.txt
-
-from __future__ import unicode_literals
-
-from frappe.model.document import Document
-
-
-class HubUser(Document):
- pass
diff --git a/erpnext/hub_node/doctype/hub_users/hub_users.json b/erpnext/hub_node/doctype/hub_users/hub_users.json
deleted file mode 100644
index d42f3fdf1b..0000000000
--- a/erpnext/hub_node/doctype/hub_users/hub_users.json
+++ /dev/null
@@ -1,72 +0,0 @@
-{
- "allow_copy": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "beta": 0,
- "creation": "2018-03-06 04:38:49.891787",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
- "fields": [
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "user",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "User",
- "length": 0,
- "no_copy": 0,
- "options": "User",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- }
- ],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 0,
- "idx": 0,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 1,
- "max_attachments": 0,
- "modified": "2020-09-18 17:26:09.703215",
- "modified_by": "Administrator",
- "module": "Hub Node",
- "name": "Hub Users",
- "name_case": "",
- "owner": "Administrator",
- "permissions": [],
- "quick_entry": 1,
- "read_only": 0,
- "read_only_onload": 0,
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 1,
- "track_seen": 0
-}
\ No newline at end of file
diff --git a/erpnext/hub_node/doctype/hub_users/hub_users.py b/erpnext/hub_node/doctype/hub_users/hub_users.py
deleted file mode 100644
index e08ed68ed8..0000000000
--- a/erpnext/hub_node/doctype/hub_users/hub_users.py
+++ /dev/null
@@ -1,11 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
-# For license information, please see license.txt
-
-from __future__ import unicode_literals
-
-from frappe.model.document import Document
-
-
-class HubUsers(Document):
- pass
diff --git a/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.js b/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.js
deleted file mode 100644
index 36da832c7c..0000000000
--- a/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
-// For license information, please see license.txt
-
-frappe.ui.form.on('Marketplace Settings', {
- refresh: function(frm) {
- $('#toolbar-user .marketplace-link').toggle(!frm.doc.disable_marketplace);
- },
-});
diff --git a/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.json b/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.json
deleted file mode 100644
index e784f68fcf..0000000000
--- a/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.json
+++ /dev/null
@@ -1,410 +0,0 @@
-{
- "allow_copy": 0,
- "allow_events_in_timeline": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "beta": 1,
- "creation": "2018-08-31 15:54:38.795263",
- "custom": 0,
- "description": "",
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 0,
- "engine": "InnoDB",
- "fields": [
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "disable_marketplace",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Disable Marketplace",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:!doc.disable_marketplace",
- "fieldname": "marketplace_settings_section",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Marketplace Settings",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "https://hubmarket.org",
- "fieldname": "marketplace_url",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Marketplace URL (to hide and update label)",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "registered",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Registered",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "sync_in_progress",
- "fieldtype": "Check",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Sync in Progress",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "company",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Company",
- "length": 0,
- "no_copy": 0,
- "options": "Company",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "hub_seller_name",
- "fieldtype": "Data",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Hub Seller Name",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "users",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Users",
- "length": 0,
- "no_copy": 0,
- "options": "Hub User",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "",
- "fieldname": "last_sync_datetime",
- "fieldtype": "Datetime",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Last Sync On",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "",
- "depends_on": "eval:1",
- "fieldname": "custom_data",
- "fieldtype": "Code",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Custom Data",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- }
- ],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 0,
- "idx": 0,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 0,
- "issingle": 1,
- "istable": 0,
- "max_attachments": 0,
- "modified": "2020-09-18 17:26:09.703215",
- "modified_by": "Administrator",
- "module": "Hub Node",
- "name": "Marketplace Settings",
- "name_case": "",
- "owner": "Administrator",
- "permissions": [
- {
- "amend": 0,
- "cancel": 0,
- "create": 1,
- "delete": 0,
- "email": 0,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 0,
- "read": 1,
- "report": 0,
- "role": "System Manager",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
- "write": 1
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 0,
- "role": "All",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 0,
- "write": 0
- }
- ],
- "quick_entry": 0,
- "read_only": 0,
- "read_only_onload": 0,
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 1,
- "track_seen": 0,
- "track_views": 0
-}
\ No newline at end of file
diff --git a/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.py b/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.py
deleted file mode 100644
index 33d23f6eae..0000000000
--- a/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.py
+++ /dev/null
@@ -1,93 +0,0 @@
-# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors and contributors
-# For license information, please see license.txt
-
-from __future__ import unicode_literals
-
-import json
-
-import frappe
-from frappe.frappeclient import FrappeClient
-from frappe.model.document import Document
-from frappe.utils import cint
-
-
-class MarketplaceSettings(Document):
-
- def register_seller(self, company, company_description):
-
- country, currency, company_logo = frappe.db.get_value('Company', company,
- ['country', 'default_currency', 'company_logo'])
-
- company_details = {
- 'company': company,
- 'country': country,
- 'currency': currency,
- 'company_description': company_description,
- 'company_logo': company_logo,
- 'site_name': frappe.utils.get_url()
- }
-
- hub_connection = self.get_connection()
-
- response = hub_connection.post_request({
- 'cmd': 'hub.hub.api.add_hub_seller',
- 'company_details': json.dumps(company_details)
- })
-
- return response
-
-
- def add_hub_user(self, user_email):
- '''Create a Hub User and User record on hub server
- and if successfull append it to Hub User table
- '''
-
- if not self.registered:
- return
-
- hub_connection = self.get_connection()
-
- first_name, last_name = frappe.db.get_value('User', user_email, ['first_name', 'last_name'])
-
- hub_user = hub_connection.post_request({
- 'cmd': 'hub.hub.api.add_hub_user',
- 'user_email': user_email,
- 'first_name': first_name,
- 'last_name': last_name,
- 'hub_seller': self.hub_seller_name
- })
-
- self.append('users', {
- 'user': hub_user.get('user_email'),
- 'hub_user_name': hub_user.get('hub_user_name'),
- 'password': hub_user.get('password')
- })
-
- self.save()
-
- def get_hub_user(self, user):
- '''Return the Hub User doc from the `users` table if password is set'''
-
- filtered_users = list(filter(
- lambda x: x.user == user and x.password,
- self.users
- ))
-
- if filtered_users:
- return filtered_users[0]
-
-
- def get_connection(self):
- return FrappeClient(self.marketplace_url)
-
-
- def unregister(self):
- """Disable the User on hubmarket.org"""
-
-@frappe.whitelist()
-def is_marketplace_enabled():
- if not hasattr(frappe.local, 'is_marketplace_enabled'):
- frappe.local.is_marketplace_enabled = cint(frappe.db.get_single_value('Marketplace Settings',
- 'disable_marketplace'))
-
- return frappe.local.is_marketplace_enabled
diff --git a/erpnext/hub_node/doctype/marketplace_settings/test_marketplace_settings.py b/erpnext/hub_node/doctype/marketplace_settings/test_marketplace_settings.py
deleted file mode 100644
index 7922f45ab5..0000000000
--- a/erpnext/hub_node/doctype/marketplace_settings/test_marketplace_settings.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
-# See license.txt
-from __future__ import unicode_literals
-
-import unittest
-
-
-class TestMarketplaceSettings(unittest.TestCase):
- pass
diff --git a/erpnext/hub_node/legacy.py b/erpnext/hub_node/legacy.py
deleted file mode 100644
index 2e4c266843..0000000000
--- a/erpnext/hub_node/legacy.py
+++ /dev/null
@@ -1,148 +0,0 @@
-from __future__ import unicode_literals
-
-import json
-
-import frappe
-from frappe.contacts.doctype.contact.contact import get_default_contact
-from frappe.frappeclient import FrappeClient
-from frappe.utils import nowdate
-from frappe.utils.nestedset import get_root_of
-
-
-def get_list(doctype, start, limit, fields, filters, order_by):
- pass
-
-def get_hub_connection():
- if frappe.db.exists('Data Migration Connector', 'Hub Connector'):
- hub_connector = frappe.get_doc('Data Migration Connector', 'Hub Connector')
- hub_connection = hub_connector.get_connection()
- return hub_connection.connection
-
- # read-only connection
- hub_connection = FrappeClient(frappe.conf.hub_url)
- return hub_connection
-
-def make_opportunity(buyer_name, email_id):
- buyer_name = "HUB-" + buyer_name
-
- if not frappe.db.exists('Lead', {'email_id': email_id}):
- lead = frappe.new_doc("Lead")
- lead.lead_name = buyer_name
- lead.email_id = email_id
- lead.save(ignore_permissions=True)
-
- o = frappe.new_doc("Opportunity")
- o.opportunity_from = "Lead"
- o.lead = frappe.get_all("Lead", filters={"email_id": email_id}, fields = ["name"])[0]["name"]
- o.save(ignore_permissions=True)
-
-@frappe.whitelist()
-def make_rfq_and_send_opportunity(item, supplier):
- supplier = make_supplier(supplier)
- contact = make_contact(supplier)
- item = make_item(item)
- rfq = make_rfq(item, supplier, contact)
- status = send_opportunity(contact)
-
- return {
- 'rfq': rfq,
- 'hub_document_created': status
- }
-
-def make_supplier(supplier):
- # make supplier if not already exists
- supplier = frappe._dict(json.loads(supplier))
-
- if not frappe.db.exists('Supplier', {'supplier_name': supplier.supplier_name}):
- supplier_doc = frappe.get_doc({
- 'doctype': 'Supplier',
- 'supplier_name': supplier.supplier_name,
- 'supplier_group': supplier.supplier_group,
- 'supplier_email': supplier.supplier_email
- }).insert()
- else:
- supplier_doc = frappe.get_doc('Supplier', supplier.supplier_name)
-
- return supplier_doc
-
-def make_contact(supplier):
- contact_name = get_default_contact('Supplier', supplier.supplier_name)
- # make contact if not already exists
- if not contact_name:
- contact = frappe.get_doc({
- 'doctype': 'Contact',
- 'first_name': supplier.supplier_name,
- 'is_primary_contact': 1,
- 'links': [
- {'link_doctype': 'Supplier', 'link_name': supplier.supplier_name}
- ]
- })
- contact.add_email(supplier.supplier_email, is_primary=True)
- contact.insert()
- else:
- contact = frappe.get_doc('Contact', contact_name)
-
- return contact
-
-def make_item(item):
- # make item if not already exists
- item = frappe._dict(json.loads(item))
-
- if not frappe.db.exists('Item', {'item_code': item.item_code}):
- item_doc = frappe.get_doc({
- 'doctype': 'Item',
- 'item_code': item.item_code,
- 'item_group': item.item_group,
- 'is_item_from_hub': 1
- }).insert()
- else:
- item_doc = frappe.get_doc('Item', item.item_code)
-
- return item_doc
-
-def make_rfq(item, supplier, contact):
- # make rfq
- rfq = frappe.get_doc({
- 'doctype': 'Request for Quotation',
- 'transaction_date': nowdate(),
- 'status': 'Draft',
- 'company': frappe.db.get_single_value('Marketplace Settings', 'company'),
- 'message_for_supplier': 'Please supply the specified items at the best possible rates',
- 'suppliers': [
- { 'supplier': supplier.name, 'contact': contact.name }
- ],
- 'items': [
- {
- 'item_code': item.item_code,
- 'qty': 1,
- 'schedule_date': nowdate(),
- 'warehouse': item.default_warehouse or get_root_of("Warehouse"),
- 'description': item.description,
- 'uom': item.stock_uom
- }
- ]
- }).insert()
-
- rfq.save()
- rfq.submit()
- return rfq
-
-def send_opportunity(contact):
- # Make Hub Message on Hub with lead data
- doc = {
- 'doctype': 'Lead',
- 'lead_name': frappe.db.get_single_value('Marketplace Settings', 'company'),
- 'email_id': frappe.db.get_single_value('Marketplace Settings', 'user')
- }
-
- args = frappe._dict(dict(
- doctype='Hub Message',
- reference_doctype='Lead',
- data=json.dumps(doc),
- user=contact.email_id
- ))
-
- connection = get_hub_connection()
- response = connection.insert('Hub Message', args)
-
- return response.ok
diff --git a/erpnext/manufacturing/doctype/bom/bom.json b/erpnext/manufacturing/doctype/bom/bom.json
index 7e539183b0..62187077f3 100644
--- a/erpnext/manufacturing/doctype/bom/bom.json
+++ b/erpnext/manufacturing/doctype/bom/bom.json
@@ -436,7 +436,7 @@
"description": "Item Image (if not slideshow)",
"fieldname": "website_image",
"fieldtype": "Attach Image",
- "label": "Image"
+ "label": "Website Image"
},
{
"allow_on_submit": 1,
@@ -539,7 +539,7 @@
"image_field": "image",
"is_submittable": 1,
"links": [],
- "modified": "2021-05-16 12:25:09.081968",
+ "modified": "2021-10-27 14:52:04.500251",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "BOM",
diff --git a/erpnext/manufacturing/doctype/work_order/work_order.json b/erpnext/manufacturing/doctype/work_order/work_order.json
index 913fc85af6..7f8e816a22 100644
--- a/erpnext/manufacturing/doctype/work_order/work_order.json
+++ b/erpnext/manufacturing/doctype/work_order/work_order.json
@@ -182,6 +182,7 @@
"reqd": 1
},
{
+ "default": "1.0",
"fieldname": "qty",
"fieldtype": "Float",
"label": "Qty To Manufacture",
@@ -572,10 +573,11 @@
"image_field": "image",
"is_submittable": 1,
"links": [],
- "modified": "2021-08-24 15:14:03.844937",
+ "modified": "2021-10-27 19:21:35.139888",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "Work Order",
+ "naming_rule": "By \"Naming Series\" field",
"nsm_parent_field": "parent_work_order",
"owner": "Administrator",
"permissions": [
diff --git a/erpnext/manufacturing/doctype/work_order/work_order.py b/erpnext/manufacturing/doctype/work_order/work_order.py
index e282dd3ecb..f881e1bf16 100644
--- a/erpnext/manufacturing/doctype/work_order/work_order.py
+++ b/erpnext/manufacturing/doctype/work_order/work_order.py
@@ -685,9 +685,7 @@ class WorkOrder(Document):
if not d.operation:
d.operation = operation
else:
- # Attribute a big number (999) to idx for sorting putpose in case idx is NULL
- # For instance in BOM Explosion Item child table, the items coming from sub assembly items
- for item in sorted(item_dict.values(), key=lambda d: d['idx'] or 9999):
+ for item in sorted(item_dict.values(), key=lambda d: d['idx'] or float('inf')):
self.append('required_items', {
'rate': item.rate,
'amount': item.rate * item.qty,
diff --git a/erpnext/modules.txt b/erpnext/modules.txt
index a9f94ce133..15a24a746f 100644
--- a/erpnext/modules.txt
+++ b/erpnext/modules.txt
@@ -20,9 +20,8 @@ Agriculture
ERPNext Integrations
Non Profit
Hotels
-Hub Node
Quality Management
Communication
Loan Management
Payroll
-Telephony
+Telephony
\ No newline at end of file
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 1dac50c6e1..2c21ab6c3a 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -58,11 +58,7 @@ erpnext.patches.v11_0.set_department_for_doctypes
erpnext.patches.v11_0.update_allow_transfer_for_manufacture
erpnext.patches.v11_0.add_item_group_defaults
erpnext.patches.v11_0.add_expense_claim_default_account
-execute:frappe.delete_doc("Page", "hub")
-erpnext.patches.v11_0.reset_publish_in_hub_for_all_items
-erpnext.patches.v11_0.update_hub_url # 2018-08-31 # 2018-09-03
erpnext.patches.v11_0.make_job_card
-erpnext.patches.v10_0.delete_hub_documents # 12-08-2018
erpnext.patches.v11_0.add_default_dispatch_notification_template
erpnext.patches.v11_0.add_market_segments
erpnext.patches.v11_0.add_sales_stages
@@ -153,7 +149,6 @@ erpnext.patches.v12_0.set_cost_center_in_child_table_of_expense_claim
erpnext.patches.v12_0.add_eway_bill_in_delivery_note
erpnext.patches.v12_0.set_lead_title_field
erpnext.patches.v12_0.set_permission_einvoicing
-erpnext.patches.v12_0.set_published_in_hub_tracked_item
erpnext.patches.v12_0.set_job_offer_applicant_email
erpnext.patches.v12_0.create_irs_1099_field_united_states
erpnext.patches.v12_0.move_bank_account_swift_number_to_bank
@@ -311,4 +306,6 @@ erpnext.patches.v13_0.requeue_failed_reposts
erpnext.patches.v12_0.update_production_plan_status
erpnext.patches.v13_0.healthcare_deprecation_warning
erpnext.patches.v14_0.delete_healthcare_doctypes
+erpnext.patches.v13_0.update_category_in_ltds_certificate
erpnext.patches.v13_0.create_pan_field_for_india #2
+erpnext.patches.v14_0.delete_hub_doctypes
diff --git a/erpnext/patches/v10_0/delete_hub_documents.py b/erpnext/patches/v10_0/delete_hub_documents.py
deleted file mode 100644
index 16c7abfc97..0000000000
--- a/erpnext/patches/v10_0/delete_hub_documents.py
+++ /dev/null
@@ -1,19 +0,0 @@
-from __future__ import unicode_literals
-
-import frappe
-
-
-def execute():
- for dt, dn in (("Page", "Hub"), ("DocType", "Hub Settings"), ("DocType", "Hub Category")):
- frappe.delete_doc(dt, dn, ignore_missing=True)
-
- if frappe.db.exists("DocType", "Data Migration Plan"):
- data_migration_plans = frappe.get_all("Data Migration Plan", filters={"module": 'Hub Node'})
- for plan in data_migration_plans:
- plan_doc = frappe.get_doc("Data Migration Plan", plan.name)
- for m in plan_doc.get("mappings"):
- frappe.delete_doc("Data Migration Mapping", m.mapping, force=True)
- docs = frappe.get_all("Data Migration Run", filters={"data_migration_plan": plan.name})
- for doc in docs:
- frappe.delete_doc("Data Migration Run", doc.name)
- frappe.delete_doc("Data Migration Plan", plan.name)
diff --git a/erpnext/patches/v11_0/reset_publish_in_hub_for_all_items.py b/erpnext/patches/v11_0/reset_publish_in_hub_for_all_items.py
deleted file mode 100644
index a664baf6dd..0000000000
--- a/erpnext/patches/v11_0/reset_publish_in_hub_for_all_items.py
+++ /dev/null
@@ -1,8 +0,0 @@
-from __future__ import unicode_literals
-
-import frappe
-
-
-def execute():
- frappe.reload_doc('stock', 'doctype', 'item')
- frappe.db.sql("""update `tabItem` set publish_in_hub = 0""")
diff --git a/erpnext/patches/v11_0/update_hub_url.py b/erpnext/patches/v11_0/update_hub_url.py
deleted file mode 100644
index c89b9b5060..0000000000
--- a/erpnext/patches/v11_0/update_hub_url.py
+++ /dev/null
@@ -1,8 +0,0 @@
-from __future__ import unicode_literals
-
-import frappe
-
-
-def execute():
- frappe.reload_doc('hub_node', 'doctype', 'Marketplace Settings')
- frappe.db.set_value('Marketplace Settings', 'Marketplace Settings', 'marketplace_url', 'https://hubmarket.org')
diff --git a/erpnext/patches/v12_0/set_published_in_hub_tracked_item.py b/erpnext/patches/v12_0/set_published_in_hub_tracked_item.py
deleted file mode 100644
index 73c6ce8220..0000000000
--- a/erpnext/patches/v12_0/set_published_in_hub_tracked_item.py
+++ /dev/null
@@ -1,14 +0,0 @@
-from __future__ import unicode_literals
-
-import frappe
-
-
-def execute():
- frappe.reload_doc("Hub Node", "doctype", "Hub Tracked Item")
- if not frappe.db.a_row_exists("Hub Tracked Item"):
- return
-
- frappe.db.sql('''
- Update `tabHub Tracked Item`
- SET published = 1
- ''')
diff --git a/erpnext/patches/v13_0/update_category_in_ltds_certificate.py b/erpnext/patches/v13_0/update_category_in_ltds_certificate.py
new file mode 100644
index 0000000000..4d4645269c
--- /dev/null
+++ b/erpnext/patches/v13_0/update_category_in_ltds_certificate.py
@@ -0,0 +1,18 @@
+import frappe
+
+
+def execute():
+ company = frappe.get_all('Company', filters = {'country': 'India'})
+ if not company:
+ return
+
+ ldc = frappe.qb.DocType("Lower Deduction Certificate").as_("ldc")
+ supplier = frappe.qb.DocType("Supplier")
+
+ frappe.qb.update(ldc).inner_join(supplier).on(
+ ldc.supplier == supplier.name
+ ).set(
+ ldc.tax_withholding_category, supplier.tax_withholding_category
+ ).where(
+ ldc.tax_withholding_category.isnull()
+ ).run()
\ No newline at end of file
diff --git a/erpnext/patches/v14_0/delete_hub_doctypes.py b/erpnext/patches/v14_0/delete_hub_doctypes.py
new file mode 100644
index 0000000000..d1e9e31f0c
--- /dev/null
+++ b/erpnext/patches/v14_0/delete_hub_doctypes.py
@@ -0,0 +1,10 @@
+import frappe
+
+
+def execute():
+
+ doctypes = frappe.get_all("DocType", {"module": "Hub Node", "custom": 0}, pluck='name')
+ for doctype in doctypes:
+ frappe.delete_doc("DocType", doctype, ignore_missing=True)
+
+ frappe.delete_doc("Module Def", "Hub Node", ignore_missing=True, force=True)
diff --git a/erpnext/public/build.json b/erpnext/public/build.json
index 6b70dab803..f8e817770d 100644
--- a/erpnext/public/build.json
+++ b/erpnext/public/build.json
@@ -1,14 +1,10 @@
{
"css/erpnext.css": [
"public/less/erpnext.less",
- "public/less/hub.less",
"public/scss/call_popup.scss",
"public/scss/point-of-sale.scss",
"public/scss/hierarchy_chart.scss"
],
- "css/marketplace.css": [
- "public/less/hub.less"
- ],
"js/erpnext-web.min.js": [
"public/js/website_utils.js",
"public/js/shopping_cart.js"
@@ -17,9 +13,6 @@
"public/scss/website.scss",
"public/scss/shopping_cart.scss"
],
- "js/marketplace.min.js": [
- "public/js/hub/marketplace.js"
- ],
"js/erpnext.min.js": [
"public/js/conf.js",
"public/js/utils.js",
@@ -41,7 +34,6 @@
"public/js/utils/supplier_quick_entry.js",
"public/js/education/student_button.html",
"public/js/education/assessment_result_tool.html",
- "public/js/hub/hub_factory.js",
"public/js/call_popup/call_popup.js",
"public/js/utils/dimension_tree_filter.js",
"public/js/telephony.js",
diff --git a/erpnext/public/images/hub_logo.svg b/erpnext/public/images/hub_logo.svg
deleted file mode 100644
index 4af482176e..0000000000
--- a/erpnext/public/images/hub_logo.svg
+++ /dev/null
@@ -1,112 +0,0 @@
-
-
-
-
diff --git a/erpnext/public/js/erpnext.bundle.js b/erpnext/public/js/erpnext.bundle.js
index febdb24da3..5259bdcc76 100644
--- a/erpnext/public/js/erpnext.bundle.js
+++ b/erpnext/public/js/erpnext.bundle.js
@@ -18,7 +18,6 @@ import "./utils/customer_quick_entry";
import "./utils/supplier_quick_entry";
import "./education/student_button.html";
import "./education/assessment_result_tool.html";
-import "./hub/hub_factory";
import "./call_popup/call_popup";
import "./utils/dimension_tree_filter";
import "./telephony";
diff --git a/erpnext/public/js/financial_statements.js b/erpnext/public/js/financial_statements.js
index 0d79b10c04..1a309ba015 100644
--- a/erpnext/public/js/financial_statements.js
+++ b/erpnext/public/js/financial_statements.js
@@ -113,15 +113,15 @@ function get_filters() {
"fieldname":"period_start_date",
"label": __("Start Date"),
"fieldtype": "Date",
- "hidden": 1,
- "reqd": 1
+ "reqd": 1,
+ "depends_on": "eval:doc.filter_based_on == 'Date Range'"
},
{
"fieldname":"period_end_date",
"label": __("End Date"),
"fieldtype": "Date",
- "hidden": 1,
- "reqd": 1
+ "reqd": 1,
+ "depends_on": "eval:doc.filter_based_on == 'Date Range'"
},
{
"fieldname":"from_fiscal_year",
@@ -129,7 +129,8 @@ function get_filters() {
"fieldtype": "Link",
"options": "Fiscal Year",
"default": frappe.defaults.get_user_default("fiscal_year"),
- "reqd": 1
+ "reqd": 1,
+ "depends_on": "eval:doc.filter_based_on == 'Fiscal Year'"
},
{
"fieldname":"to_fiscal_year",
@@ -137,7 +138,8 @@ function get_filters() {
"fieldtype": "Link",
"options": "Fiscal Year",
"default": frappe.defaults.get_user_default("fiscal_year"),
- "reqd": 1
+ "reqd": 1,
+ "depends_on": "eval:doc.filter_based_on == 'Fiscal Year'"
},
{
"fieldname": "periodicity",
diff --git a/erpnext/public/js/hub/PageContainer.vue b/erpnext/public/js/hub/PageContainer.vue
deleted file mode 100644
index 54c359766d..0000000000
--- a/erpnext/public/js/hub/PageContainer.vue
+++ /dev/null
@@ -1,119 +0,0 @@
-
- Details Ratings Desc Desc
-
-
- Name
-
-
- {{ section.title }}
-
-
- ${rating_html} -
-- ${data.content} -
-- {{ __('You can Feature upto 8 items.') }} -
- -{{ 'See All' }}
-{{ valid_items_instruction }}
- -- {{ __('You can publish upto 200 items.') }} -
-