From 429361ce873e8074878d888a12acde979d84e3c5 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Wed, 27 Apr 2022 13:32:51 +0530 Subject: [PATCH 1/2] chore: Remove domains from Setup --- .../doctype/sales_invoice/sales_invoice.js | 42 --- erpnext/hooks.py | 8 - erpnext/loan_management/loan_common.js | 5 - erpnext/public/js/setup_wizard.js | 31 --- erpnext/setup/doctype/company/company.json | 7 +- .../setup_wizard/operations/company_setup.py | 1 - .../setup_wizard/operations/defaults_setup.py | 3 - .../operations/install_fixtures.py | 13 - erpnext/setup/setup_wizard/setup_wizard.py | 6 - erpnext/setup/utils.py | 10 - erpnext/tests/server/agriculture.txt | 4 - erpnext/tests/test_woocommerce.py | 152 ----------- erpnext/tests/ui/agriculture.txt | 7 - erpnext/tests/ui/make_fixtures.js | 258 ------------------ erpnext/tests/ui/setup_wizard.js | 47 ---- erpnext/tests/ui/tests.txt | 110 -------- erpnext/tests/ui/tests2.txt | 46 ---- .../ui_test_bulk_transaction_processing.py | 21 -- erpnext/tests/ui_test_helpers.py | 75 ----- 19 files changed, 3 insertions(+), 843 deletions(-) delete mode 100644 erpnext/tests/server/agriculture.txt delete mode 100644 erpnext/tests/test_woocommerce.py delete mode 100644 erpnext/tests/ui/agriculture.txt delete mode 100644 erpnext/tests/ui/make_fixtures.js delete mode 100644 erpnext/tests/ui/setup_wizard.js delete mode 100644 erpnext/tests/ui/tests.txt delete mode 100644 erpnext/tests/ui/tests2.txt delete mode 100644 erpnext/tests/ui_test_bulk_transaction_processing.py delete mode 100644 erpnext/tests/ui_test_helpers.py diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index 0f7c13f3bbc9..e30289a62c97 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -824,29 +824,6 @@ frappe.ui.form.on('Sales Invoice', { } }, - // Healthcare - patient: function(frm) { - if (frappe.boot.active_domains.includes("Healthcare")){ - if(frm.doc.patient){ - frappe.call({ - method: "frappe.client.get_value", - args:{ - doctype: "Patient", - filters: { - "name": frm.doc.patient - }, - fieldname: "customer" - }, - callback:function(r) { - if(r && r.message.customer){ - frm.set_value("customer", r.message.customer); - } - } - }); - } - } - }, - project: function(frm) { if (frm.doc.project) { frm.events.add_timesheet_data(frm, { @@ -976,25 +953,6 @@ frappe.ui.form.on('Sales Invoice', { if (frm.doc.is_debit_note) { frm.set_df_property('return_against', 'label', __('Adjustment Against')); } - - if (frappe.boot.active_domains.includes("Healthcare")) { - frm.set_df_property("patient", "hidden", 0); - frm.set_df_property("patient_name", "hidden", 0); - frm.set_df_property("ref_practitioner", "hidden", 0); - if (cint(frm.doc.docstatus==0) && cur_frm.page.current_view_name!=="pos" && !frm.doc.is_return) { - frm.add_custom_button(__('Healthcare Services'), function() { - get_healthcare_services_to_invoice(frm); - },__("Get Items From")); - frm.add_custom_button(__('Prescriptions'), function() { - get_drugs_to_invoice(frm); - },__("Get Items From")); - } - } - else { - frm.set_df_property("patient", "hidden", 1); - frm.set_df_property("patient_name", "hidden", 1); - frm.set_df_property("ref_practitioner", "hidden", 1); - } }, create_invoice_discounting: function(frm) { diff --git a/erpnext/hooks.py b/erpnext/hooks.py index fe0a89a27690..bf4d0d8d2b44 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -83,14 +83,6 @@ "Course Schedule", ] -domains = { - "Distribution": "erpnext.domains.distribution", - "Education": "erpnext.domains.education", - "Manufacturing": "erpnext.domains.manufacturing", - "Retail": "erpnext.domains.retail", - "Services": "erpnext.domains.services", -} - website_generators = [ "Item Group", "Website Item", diff --git a/erpnext/loan_management/loan_common.js b/erpnext/loan_management/loan_common.js index 43980ffef48e..247e30b84393 100644 --- a/erpnext/loan_management/loan_common.js +++ b/erpnext/loan_management/loan_common.js @@ -3,11 +3,6 @@ frappe.ui.form.on(cur_frm.doctype, { refresh: function(frm) { - if (!frappe.boot.active_domains.includes("Non Profit")) { - frm.set_df_property('applicant_type', 'options', ['Employee', 'Customer']); - frm.refresh_field('applicant_type'); - } - if (['Loan Disbursement', 'Loan Repayment', 'Loan Interest Accrual', 'Loan Write Off'].includes(frm.doc.doctype) && frm.doc.docstatus > 0) { diff --git a/erpnext/public/js/setup_wizard.js b/erpnext/public/js/setup_wizard.js index 83b69aebc5b4..ee4463421437 100644 --- a/erpnext/public/js/setup_wizard.js +++ b/erpnext/public/js/setup_wizard.js @@ -12,37 +12,6 @@ frappe.setup.on("before_load", function () { }); erpnext.setup.slides_settings = [ - { - // Domain - name: 'domain', - title: __('Select your Domains'), - fields: [ - { - fieldname: 'domains', - label: __('Domains'), - fieldtype: 'MultiCheck', - options: [ - { "label": __("Distribution"), "value": "Distribution" }, - { "label": __("Education"), "value": "Education" }, - { "label": __("Manufacturing"), "value": "Manufacturing" }, - { "label": __("Retail"), "value": "Retail" }, - { "label": __("Services"), "value": "Services" }, - { "label": __("Healthcare (beta)"), "value": "Healthcare" }, - { "label": __("Non Profit (beta)"), "value": "Non Profit" } - ], reqd: 1 - }, - ], - // help: __('Select the nature of your business.'), - validate: function () { - if (this.values.domains.length === 0) { - frappe.msgprint(__("Please select at least one domain.")); - return false; - } - frappe.setup.domains = this.values.domains; - return true; - }, - }, - { // Brand name: 'brand', diff --git a/erpnext/setup/doctype/company/company.json b/erpnext/setup/doctype/company/company.json index 370a3278a01b..cc62a2ac7307 100644 --- a/erpnext/setup/doctype/company/company.json +++ b/erpnext/setup/doctype/company/company.json @@ -147,9 +147,8 @@ }, { "fieldname": "domain", - "fieldtype": "Link", - "label": "Domain", - "options": "Domain" + "fieldtype": "Data", + "label": "Domain" }, { "fieldname": "parent_company", @@ -748,7 +747,7 @@ "image_field": "company_logo", "is_tree": 1, "links": [], - "modified": "2022-01-25 10:33:16.826067", + "modified": "2022-04-27 10:33:16.826067", "modified_by": "Administrator", "module": "Setup", "name": "Company", diff --git a/erpnext/setup/setup_wizard/operations/company_setup.py b/erpnext/setup/setup_wizard/operations/company_setup.py index 36dd6611766e..aadc98989fa2 100644 --- a/erpnext/setup/setup_wizard/operations/company_setup.py +++ b/erpnext/setup/setup_wizard/operations/company_setup.py @@ -30,7 +30,6 @@ def create_fiscal_year_and_company(args): "country": args.get("country"), "create_chart_of_accounts_based_on": "Standard Template", "chart_of_accounts": args.get("chart_of_accounts"), - "domain": args.get("domains")[0], } ).insert() diff --git a/erpnext/setup/setup_wizard/operations/defaults_setup.py b/erpnext/setup/setup_wizard/operations/defaults_setup.py index 07321ed7acfb..ea0779864d78 100644 --- a/erpnext/setup/setup_wizard/operations/defaults_setup.py +++ b/erpnext/setup/setup_wizard/operations/defaults_setup.py @@ -26,9 +26,6 @@ def set_default_settings(args): system_settings.email_footer_address = args.get("company_name") system_settings.save() - domain_settings = frappe.get_single("Domain Settings") - domain_settings.set_active_domains(args.get("domains")) - stock_settings = frappe.get_doc("Stock Settings") stock_settings.item_naming_by = "Item Code" stock_settings.valuation_method = "FIFO" diff --git a/erpnext/setup/setup_wizard/operations/install_fixtures.py b/erpnext/setup/setup_wizard/operations/install_fixtures.py index a0056e211269..56a0f90aabc5 100644 --- a/erpnext/setup/setup_wizard/operations/install_fixtures.py +++ b/erpnext/setup/setup_wizard/operations/install_fixtures.py @@ -43,14 +43,6 @@ def install(country=None): records = [ - # domains - {"doctype": "Domain", "domain": "Distribution"}, - {"doctype": "Domain", "domain": "Manufacturing"}, - {"doctype": "Domain", "domain": "Retail"}, - {"doctype": "Domain", "domain": "Services"}, - {"doctype": "Domain", "domain": "Education"}, - {"doctype": "Domain", "domain": "Healthcare"}, - {"doctype": "Domain", "domain": "Non Profit"}, # ensure at least an empty Address Template exists for this Country {"doctype": "Address Template", "country": country}, # item group @@ -798,7 +790,6 @@ def install_defaults(args=None): frappe.db.set_value("Stock Settings", None, "email_footer_address", args.get("company_name")) set_global_defaults(args) - set_active_domains(args) update_stock_settings() update_shopping_cart_settings(args) @@ -822,10 +813,6 @@ def set_global_defaults(args): global_defaults.save() -def set_active_domains(args): - frappe.get_single("Domain Settings").set_active_domains(args.get("domains")) - - def update_stock_settings(): stock_settings = frappe.get_doc("Stock Settings") stock_settings.item_naming_by = "Item Code" diff --git a/erpnext/setup/setup_wizard/setup_wizard.py b/erpnext/setup/setup_wizard/setup_wizard.py index 4cae5191a67e..bd86a5b96931 100644 --- a/erpnext/setup/setup_wizard/setup_wizard.py +++ b/erpnext/setup/setup_wizard/setup_wizard.py @@ -36,7 +36,6 @@ def get_setup_stages(args=None): "tasks": [ {"fn": setup_defaults, "args": args, "fail_msg": _("Failed to setup defaults")}, {"fn": stage_four, "args": args, "fail_msg": _("Failed to create website")}, - {"fn": set_active_domains, "args": args, "fail_msg": _("Failed to add Domain")}, ], }, { @@ -84,8 +83,3 @@ def setup_complete(args=None): setup_defaults(args) stage_four(args) fin(args) - - -def set_active_domains(args): - domain_settings = frappe.get_single("Domain Settings") - domain_settings.set_active_domains(args.get("domains")) diff --git a/erpnext/setup/utils.py b/erpnext/setup/utils.py index 2200e6cd1df0..ed1190ad52f6 100644 --- a/erpnext/setup/utils.py +++ b/erpnext/setup/utils.py @@ -33,10 +33,8 @@ def before_tests(): "email": "test@erpnext.com", "password": "test", "chart_of_accounts": "Standard", - "domains": ["Manufacturing"], } ) - _enable_all_domains() frappe.db.sql("delete from `tabLeave Allocation`") frappe.db.sql("delete from `tabLeave Application`") @@ -131,17 +129,9 @@ def format_ces_api(data, param): def enable_all_roles_and_domains(): """enable all roles and domain for testing""" - _enable_all_domains() _enable_all_roles_for_admin() -def _enable_all_domains(): - domains = frappe.get_all("Domain", pluck="name") - if not domains: - return - frappe.get_single("Domain Settings").set_active_domains(domains) - - def _enable_all_roles_for_admin(): from frappe.desk.page.setup_wizard.setup_wizard import add_all_roles_to diff --git a/erpnext/tests/server/agriculture.txt b/erpnext/tests/server/agriculture.txt deleted file mode 100644 index 29dc9ab62de8..000000000000 --- a/erpnext/tests/server/agriculture.txt +++ /dev/null @@ -1,4 +0,0 @@ -Disease -Crop -Crop Cycle -Soil Texture \ No newline at end of file diff --git a/erpnext/tests/test_woocommerce.py b/erpnext/tests/test_woocommerce.py deleted file mode 100644 index 663464b6b789..000000000000 --- a/erpnext/tests/test_woocommerce.py +++ /dev/null @@ -1,152 +0,0 @@ -import os -import time -import unittest - -import frappe -import requests - -from erpnext.erpnext_integrations.connectors.woocommerce_connection import order - - -class TestWoocommerce(unittest.TestCase): - def setUp(self): - - woo_settings = frappe.get_doc("Woocommerce Settings") - if not woo_settings.secret: - woo_settings.secret = "ec434676aa1de0e502389f515c38f89f653119ab35e9117c7a79e576" - woo_settings.woocommerce_server_url = "https://woocommerce.mntechnique.com/" - woo_settings.api_consumer_key = "ck_fd43ff5756a6abafd95fadb6677100ce95a758a1" - woo_settings.api_consumer_secret = "cs_94360a1ad7bef7fa420a40cf284f7b3e0788454e" - woo_settings.enable_sync = 1 - woo_settings.company = "_Test Company" - woo_settings.tax_account = "Sales Expenses - _TC" - woo_settings.f_n_f_account = "Expenses - _TC" - woo_settings.creation_user = "Administrator" - woo_settings.save(ignore_permissions=True) - - def test_sales_order_for_woocommerce(self): - frappe.flags.woocomm_test_order_data = { - "id": 75, - "parent_id": 0, - "number": "74", - "order_key": "wc_order_5aa1281c2dacb", - "created_via": "checkout", - "version": "3.3.3", - "status": "processing", - "currency": "INR", - "date_created": "2018-03-08T12:10:04", - "date_created_gmt": "2018-03-08T12:10:04", - "date_modified": "2018-03-08T12:10:04", - "date_modified_gmt": "2018-03-08T12:10:04", - "discount_total": "0.00", - "discount_tax": "0.00", - "shipping_total": "150.00", - "shipping_tax": "0.00", - "cart_tax": "0.00", - "total": "649.00", - "total_tax": "0.00", - "prices_include_tax": False, - "customer_id": 12, - "customer_ip_address": "103.54.99.5", - "customer_user_agent": "mozilla\\/5.0 (x11; linux x86_64) applewebkit\\/537.36 (khtml, like gecko) chrome\\/64.0.3282.186 safari\\/537.36", - "customer_note": "", - "billing": { - "first_name": "Tony", - "last_name": "Stark", - "company": "_Test Company", - "address_1": "Mumbai", - "address_2": "", - "city": "Dadar", - "state": "MH", - "postcode": "123", - "country": "IN", - "email": "tony@gmail.com", - "phone": "123457890", - }, - "shipping": { - "first_name": "Tony", - "last_name": "Stark", - "company": "", - "address_1": "Mumbai", - "address_2": "", - "city": "Dadar", - "state": "MH", - "postcode": "123", - "country": "IN", - }, - "payment_method": "cod", - "payment_method_title": "Cash on delivery", - "transaction_id": "", - "date_paid": "", - "date_paid_gmt": "", - "date_completed": "", - "date_completed_gmt": "", - "cart_hash": "8e76b020d5790066496f244860c4703f", - "meta_data": [], - "line_items": [ - { - "id": 80, - "name": "Marvel", - "product_id": 56, - "variation_id": 0, - "quantity": 1, - "tax_class": "", - "subtotal": "499.00", - "subtotal_tax": "0.00", - "total": "499.00", - "total_tax": "0.00", - "taxes": [], - "meta_data": [], - "sku": "", - "price": 499, - } - ], - "tax_lines": [], - "shipping_lines": [ - { - "id": 81, - "method_title": "Flat rate", - "method_id": "flat_rate:1", - "total": "150.00", - "total_tax": "0.00", - "taxes": [], - "meta_data": [{"id": 623, "key": "Items", "value": "Marvel × 1"}], - } - ], - "fee_lines": [], - "coupon_lines": [], - "refunds": [], - } - order() - - self.assertTrue(frappe.get_value("Customer", {"woocommerce_email": "tony@gmail.com"})) - self.assertTrue(frappe.get_value("Item", {"woocommerce_id": 56})) - self.assertTrue(frappe.get_value("Sales Order", {"woocommerce_id": 75})) - frappe.flags.woocomm_test_order_data = {} - - -def emulate_request(): - # Emulate Woocommerce Request - headers = { - "X-Wc-Webhook-Event": "created", - "X-Wc-Webhook-Signature": "h1SjzQMPwd68MF5bficeFq20/RkQeRLsb9AVCUz/rLs=", - } - # Emulate Request Data - data = """{"id":74,"parent_id":0,"number":"74","order_key":"wc_order_5aa1281c2dacb","created_via":"checkout","version":"3.3.3","status":"processing","currency":"INR","date_created":"2018-03-08T12:10:04","date_created_gmt":"2018-03-08T12:10:04","date_modified":"2018-03-08T12:10:04","date_modified_gmt":"2018-03-08T12:10:04","discount_total":"0.00","discount_tax":"0.00","shipping_total":"150.00","shipping_tax":"0.00","cart_tax":"0.00","total":"649.00","total_tax":"0.00","prices_include_tax":false,"customer_id":12,"customer_ip_address":"103.54.99.5","customer_user_agent":"mozilla\\/5.0 (x11; linux x86_64) applewebkit\\/537.36 (khtml, like gecko) chrome\\/64.0.3282.186 safari\\/537.36","customer_note":"","billing":{"first_name":"Tony","last_name":"Stark","company":"Woocommerce","address_1":"Mumbai","address_2":"","city":"Dadar","state":"MH","postcode":"123","country":"IN","email":"tony@gmail.com","phone":"123457890"},"shipping":{"first_name":"Tony","last_name":"Stark","company":"","address_1":"Mumbai","address_2":"","city":"Dadar","state":"MH","postcode":"123","country":"IN"},"payment_method":"cod","payment_method_title":"Cash on delivery","transaction_id":"","date_paid":null,"date_paid_gmt":null,"date_completed":null,"date_completed_gmt":null,"cart_hash":"8e76b020d5790066496f244860c4703f","meta_data":[],"line_items":[{"id":80,"name":"Marvel","product_id":56,"variation_id":0,"quantity":1,"tax_class":"","subtotal":"499.00","subtotal_tax":"0.00","total":"499.00","total_tax":"0.00","taxes":[],"meta_data":[],"sku":"","price":499}],"tax_lines":[],"shipping_lines":[{"id":81,"method_title":"Flat rate","method_id":"flat_rate:1","total":"150.00","total_tax":"0.00","taxes":[],"meta_data":[{"id":623,"key":"Items","value":"Marvel × 1"}]}],"fee_lines":[],"coupon_lines":[],"refunds":[]}""" - - # Build URL - port = frappe.get_site_config().webserver_port or "8000" - - if os.environ.get("CI"): - host = "localhost" - else: - host = frappe.local.site - - url = "http://{site}:{port}/api/method/erpnext.erpnext_integrations.connectors.woocommerce_connection.order".format( - site=host, port=port - ) - - r = requests.post(url=url, headers=headers, data=data) - - time.sleep(5) - return r diff --git a/erpnext/tests/ui/agriculture.txt b/erpnext/tests/ui/agriculture.txt deleted file mode 100644 index 4622bc0df353..000000000000 --- a/erpnext/tests/ui/agriculture.txt +++ /dev/null @@ -1,7 +0,0 @@ -erpnext/agriculture/doctype/land_unit/test_land_unit.js -erpnext/agriculture/doctype/fertilizer/test_fertilizer.js -erpnext/agriculture/doctype/water_analysis/test_water_analysis.js -erpnext/agriculture/doctype/disease/test_disease.js -erpnext/agriculture/doctype/soil_texture/test_soil_texture.js -erpnext/agriculture/doctype/crop/test_crop.js -erpnext/agriculture/doctype/crop_cycle/test_crop_cycle.js \ No newline at end of file diff --git a/erpnext/tests/ui/make_fixtures.js b/erpnext/tests/ui/make_fixtures.js deleted file mode 100644 index 8c9e50884af1..000000000000 --- a/erpnext/tests/ui/make_fixtures.js +++ /dev/null @@ -1,258 +0,0 @@ -$.extend(frappe.test_data, { - // "Fiscal Year": { - // "2017-18": [ - // {"year": "2017-18"}, - // {"year_start_date": "2017-04-01"}, - // {"year_end_date": "2018-03-31"}, - // ] - // }, - "Customer": { - "Test Customer 1": [ - {customer_name: "Test Customer 1"} - ], - "Test Customer 2": [ - {customer_name: "Test Customer 2"} - ], - "Test Customer 3": [ - {customer_name: "Test Customer 3"} - ], - }, - "Item": { - "Test Product 1": [ - {item_code: "Test Product 1"}, - {item_group: "Products"}, - {is_stock_item: 1}, - {standard_rate: 100}, - {opening_stock: 100}, - ], - "Test Product 2": [ - {item_code: "Test Product 2"}, - {item_group: "Products"}, - {is_stock_item: 1}, - {standard_rate: 150}, - {opening_stock: 200}, - ], - "Test Product 3": [ - {item_code: "Test Product 3"}, - {item_group: "Products"}, - {is_stock_item: 1}, - {standard_rate: 250}, - {opening_stock: 100}, - {stock_uom:'Kg'} - ], - "Test Service 1": [ - {item_code: "Test Service 1"}, - {item_group: "Services"}, - {is_stock_item: 0}, - {standard_rate: 200} - ], - "Test Service 2": [ - {item_code: "Test Service 2"}, - {item_group: "Services"}, - {is_stock_item: 0}, - {standard_rate: 300} - ] - }, - "Lead": { - "LEAD-00001": [ - {lead_name: "Test Lead 1"} - ], - "LEAD-00002": [ - {lead_name: "Test Lead 2"} - ], - "LEAD-00003": [ - {lead_name: "Test Lead 3"} - ] - }, - "Address": { - "Test1-Billing": [ - {address_title:"Test1"}, - {address_type: "Billing"}, - {address_line1: "Billing Street 1"}, - {city: "Billing City 1"}, - {links: [ - [ - {link_doctype: "Customer"}, - {link_name: "Test Customer 1"} - ] - ]} - ], - "Test1-Shipping": [ - {address_title:"Test1"}, - {address_type: "Shipping"}, - {address_line1: "Shipping Street 1"}, - {city: "Shipping City 1"}, - {links: [ - [ - {link_doctype: "Customer"}, - {link_name: "Test Customer 1"} - ] - ]} - ], - "Test1-Warehouse": [ - {address_title:"Test1"}, - {address_type: "Warehouse"}, - {address_line1: "Warehouse Street 1"}, - {city: "Warehouse City 1"}, - {links: [ - [ - {link_doctype: "Customer"}, - {link_name: "Test Customer 1"} - ] - ]} - ], - "Test2-Billing": [ - {address_title:"Test2"}, - {address_type: "Billing"}, - {address_line1: "Billing Street 2"}, - {city: "Billing City 2"}, - {links: [ - [ - {link_doctype: "Customer"}, - {link_name: "Test Customer 2"} - ] - ]} - ], - "Test2-Shipping": [ - {address_title:"Test2"}, - {address_type: "Shipping"}, - {address_line1: "Shipping Street 2"}, - {city: "Shipping City 2"}, - {links: [ - [ - {link_doctype: "Customer"}, - {link_name: "Test Customer 2"} - ] - ]} - ], - "Test2-Warehouse": [ - {address_title:"Test2"}, - {address_type: "Warehouse"}, - {address_line1: "Warehouse Street 2"}, - {city: "Warehouse City 2"}, - {links: [ - [ - {link_doctype: "Customer"}, - {link_name: "Test Customer 2"} - ] - ]} - ] - }, - "Contact": { - "Contact 1-Test Customer 1": [ - {first_name: "Contact 1"}, - {links: [ - [ - {link_doctype: "Customer"}, - {link_name: "Test Customer 1"} - ] - ]} - ], - "Contact 2-Test Customer 1": [ - {first_name: "Contact 2"}, - {links: [ - [ - {link_doctype: "Customer"}, - {link_name: "Test Customer 1"} - ] - ]} - ], - "Contact 1-Test Customer 2": [ - {first_name: "Contact 1"}, - {links: [ - [ - {link_doctype: "Customer"}, - {link_name: "Test Customer 2"} - ] - ]} - ], - "Contact 2-Test Customer 2": [ - {first_name: "Contact 2"}, - {links: [ - [ - {link_doctype: "Customer"}, - {link_name: "Test Customer 2"} - ] - ]} - ], - }, - "Price List": { - "Test-Buying-USD": [ - {price_list_name: "Test-Buying-USD"}, - {currency: "USD"}, - {buying: "1"} - ], - "Test-Buying-EUR": [ - {price_list_name: "Test-Buying-EUR"}, - {currency: "EUR"}, - {buying: "1"} - ], - "Test-Selling-USD": [ - {price_list_name: "Test-Selling-USD"}, - {currency: "USD"}, - {selling: "1"} - ], - "Test-Selling-EUR": [ - {price_list_name: "Test-Selling-EUR"}, - {currency: "EUR"}, - {selling: "1"} - ], - }, - "Terms and Conditions": { - "Test Term 1": [ - {title: "Test Term 1"} - ], - "Test Term 2": [ - {title: "Test Term 2"} - ] - }, - "Item Price": { - "ITEM-PRICE-00001": [ - {item_code: 'Test Product 1'}, - {price_list: '_Test Price List'}, - {price_list_rate: 100} - ], - "ITEM-PRICE-00002": [ - {item_code: 'Test Product 2'}, - {price_list: '_Test Price List'}, - {price_list_rate: 200} - ] - }, - "Payment Term": { - "_Test Payment Term": [ - {payment_term_name: '_Test Payment Term'}, - {due_date_based_on: 'Day(s) after invoice date'}, - {invoice_portion: 100}, - {credit_days: 0} - ] - }, - "Payment Terms Template": { - "_Test Payment Term Template UI": [ - {template_name: "_Test Payment Term Template UI"}, - {terms: [ - [ - {payment_term: '_Test Payment Term'}, - {invoice_portion: 100} - ] - ]} - ] - } -}); - - -// this is a script that creates all fixtures -// called as a test -QUnit.module('fixture'); - -QUnit.test('Make fixtures', assert => { - // create all fixtures first - assert.expect(0); - let done = assert.async(); - let tasks = []; - Object.keys(frappe.test_data).forEach(function(doctype) { - tasks.push(function() { - return frappe.tests.setup_doctype(doctype, frappe.test_data[doctype]); - }); - }); - frappe.run_serially(tasks).then(() => done()); -}); diff --git a/erpnext/tests/ui/setup_wizard.js b/erpnext/tests/ui/setup_wizard.js deleted file mode 100644 index ccff785ec948..000000000000 --- a/erpnext/tests/ui/setup_wizard.js +++ /dev/null @@ -1,47 +0,0 @@ -const path = require('path'); -const path_join = path.resolve; -const apps_path = path_join(__dirname, '..', '..', '..', '..'); -const frappe_ui_tests_path = path_join(apps_path, 'frappe', 'frappe', 'tests', 'ui'); - -const login = require(frappe_ui_tests_path + "/login.js")['Login']; -const welcome = require(frappe_ui_tests_path + "/setup_wizard.js")['Welcome']; -const region = require(frappe_ui_tests_path + "/setup_wizard.js")['Region']; -const user = require(frappe_ui_tests_path + "/setup_wizard.js")['User']; - -module.exports = { - before: browser => { - browser - .url(browser.launch_url + '/login') - .waitForElementVisible('body', 5000); - }, - 'Login': login, - 'Welcome': welcome, - 'Region': region, - 'User': user, - 'Domain': browser => { - let slide_selector = '[data-slide-name="domain"]'; - browser - .waitForElementVisible(slide_selector, 2000) - .setValue('select[data-fieldname="domain"]', "Manufacturing") - .click(slide_selector + ' .next-btn'); - }, - 'Brand': browser => { - let slide_selector = '[data-slide-name="brand"]'; - browser - .waitForElementVisible(slide_selector, 2000) - .setValue('input[data-fieldname="company_name"]', "Acme") - .click(slide_selector + " .next-btn"); - }, - 'Organisation': browser => { - let slide_selector = '[data-slide-name="organisation"]'; - browser - .waitForElementVisible(slide_selector, 2000) - .setValue('input[data-fieldname="company_tagline"]', "Build tools for Builders") - .setValue('input[data-fieldname="bank_account"]', "YNG") - .click(slide_selector + " .next-btn"); - }, - - after: browser => { - browser.end(); - }, -}; diff --git a/erpnext/tests/ui/tests.txt b/erpnext/tests/ui/tests.txt deleted file mode 100644 index 5e238e449ee3..000000000000 --- a/erpnext/tests/ui/tests.txt +++ /dev/null @@ -1,110 +0,0 @@ -erpnext/tests/ui/make_fixtures.js #long -erpnext/accounts/doctype/account/tests/test_account.js -erpnext/accounts/doctype/account/tests/test_make_tax_account.js -erpnext/accounts/doctype/account/tests/test_account_with_number.js -erpnext/accounts/doctype/pricing_rule/tests/test_pricing_rule.js -erpnext/accounts/doctype/sales_taxes_and_charges_template/test_sales_taxes_and_charges_template.js -erpnext/accounts/doctype/purchase_taxes_and_charges_template/test_purchase_taxes_and_charges_template.js -erpnext/accounts/doctype/shipping_rule/test_shipping_rule.js -erpnext/crm/doctype/opportunity/test_opportunity.js -erpnext/stock/doctype/item/tests/test_item.js -erpnext/selling/doctype/quotation/tests/test_quotation_with_discount_on_grand_total.js -erpnext/selling/doctype/quotation/tests/test_quotation_with_item_wise_discount.js -erpnext/selling/doctype/quotation/tests/test_quotation_with_multi_uom.js -erpnext/selling/doctype/quotation/tests/test_quotation_with_taxes_and_charges.js -erpnext/selling/doctype/quotation/tests/test_quotation_with_shipping_rule.js -erpnext/selling/doctype/quotation/tests/test_quotation.js -erpnext/selling/doctype/sales_order/tests/test_sales_order.js -erpnext/selling/doctype/sales_order/tests/test_sales_order_with_multiple_delivery_date.js -erpnext/selling/doctype/sales_order/tests/test_sales_order_with_item_wise_discount.js -erpnext/selling/doctype/sales_order/tests/test_sales_order_with_multi_uom.js -erpnext/selling/doctype/sales_order/tests/test_sales_order_with_discount_on_grand_total.js -erpnext/selling/doctype/sales_order/tests/test_sales_order_with_taxes_and_charges.js -erpnext/selling/doctype/sales_order/tests/test_sales_order_with_shipping_rule.js -erpnext/selling/doctype/sales_order/tests/test_sales_order_with_pricing_rule.js -erpnext/manufacturing/doctype/workstation/test_workstation.js -erpnext/manufacturing/doctype/operation/test_operation.js -erpnext/manufacturing/doctype/bom/test_bom.js -erpnext/projects/doctype/project/project_timesheet.js -erpnext/hr/doctype/holiday_list/test_holiday_list.js -erpnext/hr/doctype/branch/test_branch.js -erpnext/hr/doctype/leave_block_list/test_leave_block_list.js -erpnext/hr/doctype/department/test_department.js -erpnext/hr/doctype/designation/test_designation.js -erpnext/hr/doctype/employment_type/test_employment_type.js -erpnext/hr/doctype/employee/test_employee.js -erpnext/hr/doctype/employee_attendance_tool/test_employee_attendance_tool.js -erpnext/hr/doctype/attendance/test_attendance.js -erpnext/hr/doctype/leave_type/test_leave_type.js -erpnext/hr/doctype/leave_control_panel/test_leave_control_panel.js -erpnext/hr/doctype/leave_allocation/test_leave_allocation.js -erpnext/hr/doctype/leave_application/test_leave_application.js -erpnext/stock/doctype/warehouse/test_warehouse.js -erpnext/manufacturing/doctype/work_order/test_work_order.js #long -erpnext/accounts/page/pos/test_pos.js -erpnext/selling/page/point_of_sale/tests/test_point_of_sale.js -erpnext/selling/doctype/product_bundle/test_product_bundle.js -erpnext/stock/doctype/delivery_note/test_delivery_note.js -erpnext/stock/doctype/material_request/tests/test_material_request.js -erpnext/stock/doctype/material_request/tests/test_material_request_type_material_issue.js -erpnext/stock/doctype/material_request/tests/test_material_request_type_material_transfer.js -erpnext/stock/doctype/material_request/tests/test_material_request_type_manufacture.js -erpnext/stock/doctype/stock_entry/tests/test_stock_entry_for_material_issue.js -erpnext/stock/doctype/stock_entry/tests/test_stock_entry_for_material_receipt.js -erpnext/stock/doctype/stock_entry/tests/test_stock_entry_for_material_transfer.js -erpnext/hr/doctype/salary_structure/test_salary_structure.js -erpnext/hr/doctype/salary_slip/test_salary_slip.js -erpnext/hr/doctype/job_opening/test_job_opening.js -erpnext/hr/doctype/job_applicant/test_job_applicant.js -erpnext/hr/doctype/job_offer/test_job_offer.js -erpnext/hr/doctype/appraisal_template/test_appraisal_template.js -erpnext/hr/doctype/appraisal/test_appraisal.js -erpnext/hr/doctype/expense_claim_type/test_expense_claim_type.js -erpnext/hr/doctype/expense_claim/test_expense_claim.js -erpnext/hr/doctype/training_event/tests/test_training_event.js -erpnext/hr/doctype/training_result_employee/test_training_result.js -erpnext/hr/doctype/training_feedback/test_training_feedback.js -erpnext/hr/doctype/loan_type/test_loan_type.js -erpnext/hr/doctype/loan_application/test_loan_application.js -erpnext/hr/doctype/loan/test_loan.js -erpnext/buying/doctype/supplier/test_supplier.js -erpnext/buying/doctype/request_for_quotation/tests/test_request_for_quotation.js -erpnext/buying/doctype/supplier_quotation/tests/test_supplier_quotation.js -erpnext/buying/doctype/supplier_quotation/tests/test_supplier_quotation_for_taxes_and_charges.js -erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice.js -erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_payment.js -erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_payment_request.js -erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.js -erpnext/accounts/doctype/payment_entry/tests/test_payment_against_purchase_invoice.js -erpnext/buying/doctype/supplier_quotation/tests/test_supplier_quotation_for_item_wise_discount.js -erpnext/buying/doctype/purchase_order/tests/test_purchase_order.js -erpnext/buying/doctype/purchase_order/tests/test_purchase_order_with_multi_uom.js -erpnext/buying/doctype/purchase_order/tests/test_purchase_order_get_items.js -erpnext/buying/doctype/purchase_order/tests/test_purchase_order_with_discount_on_grand_total.js -erpnext/buying/doctype/purchase_order/tests/test_purchase_order_with_item_wise_discount.js -erpnext/buying/doctype/purchase_order/tests/test_purchase_order_with_taxes_and_charges.js -erpnext/buying/doctype/purchase_order/tests/test_purchase_order_receipt.js -erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.js -erpnext/accounts/doctype/journal_entry/test_journal_entry.js -erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.js -erpnext/accounts/doctype/payment_entry/tests/test_payment_entry.js -erpnext/selling/doctype/quotation/tests/test_quotation_submit_cancel_amend.js -erpnext/stock/doctype/batch/test_batch.js -erpnext/accounts/doctype/bank_reconciliation/test_bank_reconciliation.js -erpnext/stock/doctype/stock_entry/tests/test_stock_entry_for_material_receipt_for_serialize_item.js -erpnext/stock/doctype/stock_entry/tests/test_stock_entry_for_material_transfer_for_manufacture.js -erpnext/stock/doctype/stock_entry/tests/test_stock_entry_for_subcontract.js -erpnext/stock/doctype/stock_entry/tests/test_stock_entry_for_material_issue_with_serialize_item.js -erpnext/stock/doctype/stock_entry/tests/test_stock_entry_for_repack.js -erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_serialize_item.js -erpnext/accounts/doctype/payment_entry/tests/test_payment_against_invoice.js -erpnext/buying/doctype/purchase_order/tests/test_purchase_order_with_last_purchase_rate.js -erpnext/stock/doctype/item_price/test_item_price.js -erpnext/stock/doctype/delivery_note/test_delivery_note_with_margin.js -erpnext/selling/doctype/sales_order/tests/test_sales_order_with_margin.js -erpnext/selling/doctype/quotation/tests/test_quotation_with_margin.js -erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_margin.js -erpnext/hr/doctype/payroll_entry/test_set_salary_components.js -erpnext/hr/doctype/payroll_entry/test_payroll_entry.js -erpnext/accounts/doctype/pricing_rule/tests/test_pricing_rule_with_same_currency.js -erpnext/accounts/doctype/pricing_rule/tests/test_pricing_rule_with_different_currency.js \ No newline at end of file diff --git a/erpnext/tests/ui/tests2.txt b/erpnext/tests/ui/tests2.txt deleted file mode 100644 index e410a83b2e4f..000000000000 --- a/erpnext/tests/ui/tests2.txt +++ /dev/null @@ -1,46 +0,0 @@ -erpnext/setup/doctype/company/tests/test_company.js -erpnext/crm/doctype/lead/tests/test_lead_individual.js -erpnext/crm/doctype/lead/tests/test_lead_organization.js -erpnext/setup/doctype/company/tests/test_company_production.js -erpnext/hr/doctype/leave_block_list/test_leave_block_list.js -erpnext/hr/doctype/department/test_department.js -erpnext/hr/doctype/designation/test_designation.js -erpnext/education/doctype/academic_year/test_academic_year.js -erpnext/education/doctype/academic_term/test_academic_term.js -erpnext/education/doctype/education_settings/test_education_settings.js -erpnext/education/doctype/student_batch_name/test_student_batch_name.js -erpnext/education/doctype/student_category/test_student_category.js -erpnext/education/doctype/room/test_room.js -erpnext/education/doctype/instructor/test_instructor.js -erpnext/education/doctype/grading_scale/test_grading_scale.js -erpnext/education/doctype/assessment_criteria_group/test_assessment_criteria_group.js -erpnext/education/doctype/assessment_criteria/test_assessment_criteria.js -erpnext/education/doctype/course/test_course.js -erpnext/education/doctype/program/test_program.js -erpnext/education/doctype/guardian/test_guardian.js -erpnext/education/doctype/student_admission/test_student_admission.js -erpnext/education/doctype/student_applicant/tests/test_student_applicant_dummy_data.js -erpnext/education/doctype/student_applicant/tests/test_student_applicant.js -erpnext/education/doctype/student_applicant/tests/test_student_applicant_options.js -erpnext/education/doctype/student_log/test_student_log.js -erpnext/education/doctype/student_group/test_student_group.js -erpnext/education/doctype/student_group_creation_tool/test_student_group_creation_tool.js -erpnext/education/doctype/student_leave_application/test_student_leave_application.js -erpnext/education/doctype/student_attendance_tool/test_student_attendance_tool.js -erpnext/education/doctype/student_attendance/test_student_attendance.js -erpnext/education/doctype/assessment_group/test_assessment_group.js -erpnext/education/doctype/assessment_plan/test_assessment_plan.js -erpnext/education/doctype/assessment_result/test_assessment_result.js -erpnext/education/doctype/assessment_result_tool/test_assessment_result_tool.js -erpnext/projects/doctype/task/tests/test_task_tree.js -erpnext/restaurant/doctype/restaurant/test_restaurant.js -erpnext/restaurant/doctype/restaurant_table/test_restaurant_table.js -erpnext/restaurant/doctype/restaurant_menu/test_restaurant_menu.js -erpnext/restaurant/doctype/restaurant_order_entry/restaurant_order_entry.js -erpnext/non_profit/doctype/membership_type/test_membership_type.js -erpnext/non_profit/doctype/member/test_member.js -erpnext/non_profit/doctype/volunteer_type/test_volunteer_type.js -erpnext/non_profit/doctype/volunteer/test_volunteer.js -erpnext/non_profit/doctype/donor_type/test_donor_type.js -erpnext/non_profit/doctype/donor/test_donor.js -erpnext/non_profit/doctype/grant_application/test_grant_application.js \ No newline at end of file diff --git a/erpnext/tests/ui_test_bulk_transaction_processing.py b/erpnext/tests/ui_test_bulk_transaction_processing.py deleted file mode 100644 index a0dc76d54f5b..000000000000 --- a/erpnext/tests/ui_test_bulk_transaction_processing.py +++ /dev/null @@ -1,21 +0,0 @@ -import frappe - -from erpnext.bulk_transaction.doctype.bulk_transaction_logger.test_bulk_transaction_logger import ( - create_company, - create_customer, - create_item, - create_so, -) - - -@frappe.whitelist() -def create_records(): - create_company() - create_customer() - create_item() - - gd = frappe.get_doc("Global Defaults") - gd.set("default_company", "Test Bulk") - gd.save() - frappe.clear_cache() - create_so() diff --git a/erpnext/tests/ui_test_helpers.py b/erpnext/tests/ui_test_helpers.py deleted file mode 100644 index 44834c8a77c8..000000000000 --- a/erpnext/tests/ui_test_helpers.py +++ /dev/null @@ -1,75 +0,0 @@ -import frappe -from frappe.utils import getdate - - -@frappe.whitelist() -def create_employee_records(): - create_company() - create_missing_designation() - - frappe.db.sql("DELETE FROM tabEmployee WHERE company='Test Org Chart'") - - emp1 = create_employee("Test Employee 1", "CEO") - emp2 = create_employee("Test Employee 2", "CTO") - emp3 = create_employee("Test Employee 3", "Head of Marketing and Sales", emp1) - emp4 = create_employee("Test Employee 4", "Project Manager", emp2) - emp5 = create_employee("Test Employee 5", "Engineer", emp2) - emp6 = create_employee("Test Employee 6", "Analyst", emp3) - emp7 = create_employee("Test Employee 7", "Software Developer", emp4) - - employees = [emp1, emp2, emp3, emp4, emp5, emp6, emp7] - return employees - - -@frappe.whitelist() -def get_employee_records(): - return frappe.db.get_list( - "Employee", filters={"company": "Test Org Chart"}, pluck="name", order_by="name" - ) - - -def create_company(): - company = frappe.db.exists("Company", "Test Org Chart") - if not company: - company = ( - frappe.get_doc( - { - "doctype": "Company", - "company_name": "Test Org Chart", - "country": "India", - "default_currency": "INR", - } - ) - .insert() - .name - ) - - return company - - -def create_employee(first_name, designation, reports_to=None): - employee = frappe.db.exists("Employee", {"first_name": first_name, "designation": designation}) - if not employee: - employee = ( - frappe.get_doc( - { - "doctype": "Employee", - "first_name": first_name, - "company": "Test Org Chart", - "gender": "Female", - "date_of_birth": getdate("08-12-1998"), - "date_of_joining": getdate("01-01-2021"), - "designation": designation, - "reports_to": reports_to, - } - ) - .insert() - .name - ) - - return employee - - -def create_missing_designation(): - if not frappe.db.exists("Designation", "CTO"): - frappe.get_doc({"doctype": "Designation", "designation_name": "CTO"}).insert() From 322f0db1e9f03716ff635dd343cec2f31e35df10 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Tue, 3 May 2022 18:28:50 +0530 Subject: [PATCH 2/2] chore: Resolve conflicts --- erpnext/hooks.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/erpnext/hooks.py b/erpnext/hooks.py index d93c5818d548..066249ba22fd 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -80,14 +80,7 @@ "Holiday List", ] -website_generators = [ - "Item Group", - "Website Item", - "BOM", - "Sales Partner", - "Job Opening", - "Student Admission", -] +website_generators = ["Item Group", "Website Item", "BOM", "Sales Partner", "Job Opening"] website_context = { "favicon": "/assets/erpnext/images/erpnext-favicon.svg",