Merge branch 'develop' of https://github.com/frappe/erpnext into move-exotel-to-separate-app

This commit is contained in:
Suraj Shetty
2022-05-08 16:10:55 +05:30
580 changed files with 2329 additions and 29325 deletions

View File

@@ -1,4 +0,0 @@
Disease
Crop
Crop Cycle
Soil Texture

View File

@@ -0,0 +1,9 @@
from frappe.tests.utils import FrappeTestCase
from erpnext.utilities.activation import get_level
class TestActivation(FrappeTestCase):
def test_activation(self):
levels = get_level()
self.assertTrue(levels)

View File

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

View File

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

View File

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

View File

@@ -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();
},
};

View File

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

View File

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

View File

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

View File

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