<commit_before># Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt

from __future__ import unicode_literals

import frappe
from frappe.utils.make_random import add_random_children, get_random
import frappe.utils

def make_sample_data():
	"""Create a few opportunities, quotes, material requests, issues, todos, projects
	to help the user get started"""

	selling_items = frappe.get_all("Item", filters = {"is_sales_item": 1})
	buying_items = frappe.get_all("Item", filters = {"is_sales_item": 0})

	if selling_items:
		for i in range(3):
			make_opportunity(selling_items)
			make_quote(selling_items)

	make_projects()

	if buying_items:
		make_material_request(buying_items)

	frappe.db.commit()

def make_opportunity(selling_items):
	b = frappe.get_doc({
		"doctype": "Opportunity",
		"enquiry_from": "Customer",
		"customer": get_random("Customer"),
		"enquiry_type": "Sales",<commit_msg>[minor] fix setup wizard buying_items query<commit_after># Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt

from __future__ import unicode_literals

import frappe
from frappe.utils.make_random import add_random_children, get_random
import frappe.utils

def make_sample_data():
	"""Create a few opportunities, quotes, material requests, issues, todos, projects
	to help the user get started"""

	selling_items = frappe.get_all("Item", filters = {"is_sales_item": 1})
	buying_items = frappe.get_all("Item", filters = {"is_purchase_item": 1})

	if selling_items:
		for i in range(3):
			make_opportunity(selling_items)
			make_quote(selling_items)

	make_projects()

	if buying_items:
		make_material_request(buying_items)

	frappe.db.commit()

def make_opportunity(selling_items):
	b = frappe.get_doc({
		"doctype": "Opportunity",
		"enquiry_from": "Customer",
		"customer": get_random("Customer"),
		"enquiry_type": "Sales",
{'fraction_non_alphanumeric': 0.10981189628876462, 'fraction_numerical': 0.00813421453990849, 'mean_word_length': 6.0285714285714285, 'pattern_counts': {'":': 12, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2971209', 'n_tokens_mistral': 694, 'n_tokens_neox': 645, 'n_words': 172}