chore: remove all six compat code
This commit is contained in:
		
							parent
							
								
									56a25a0c4f
								
							
						
					
					
						commit
						8fe5feb6a4
					
				| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| import inspect | import inspect | ||||||
| 
 | 
 | ||||||
| import frappe | import frappe | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| import frappe | import frappe | ||||||
| from frappe import _ | from frappe import _ | ||||||
| from frappe.email import sendmail_to_system_managers | from frappe.email import sendmail_to_system_managers | ||||||
|  | |||||||
| @ -7,7 +7,6 @@ import os | |||||||
| import frappe | import frappe | ||||||
| from frappe.utils import cstr | from frappe.utils import cstr | ||||||
| from frappe.utils.nestedset import rebuild_tree | from frappe.utils.nestedset import rebuild_tree | ||||||
| from six import iteritems |  | ||||||
| from unidecode import unidecode | from unidecode import unidecode | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -17,7 +16,7 @@ def create_charts(company, chart_template=None, existing_company=None, custom_ch | |||||||
| 		accounts = [] | 		accounts = [] | ||||||
| 
 | 
 | ||||||
| 		def _import_accounts(children, parent, root_type, root_account=False): | 		def _import_accounts(children, parent, root_type, root_account=False): | ||||||
| 			for account_name, child in iteritems(children): | 			for account_name, child in children.items(): | ||||||
| 				if root_account: | 				if root_account: | ||||||
| 					root_type = child.get("root_type") | 					root_type = child.get("root_type") | ||||||
| 
 | 
 | ||||||
| @ -200,7 +199,7 @@ def validate_bank_account(coa, bank_account): | |||||||
| 
 | 
 | ||||||
| 	if chart: | 	if chart: | ||||||
| 		def _get_account_names(account_master): | 		def _get_account_names(account_master): | ||||||
| 			for account_name, child in iteritems(account_master): | 			for account_name, child in account_master.items(): | ||||||
| 				if account_name not in ["account_number", "account_type", | 				if account_name not in ["account_number", "account_type", | ||||||
| 					"root_type", "is_group", "tax_rate"]: | 					"root_type", "is_group", "tax_rate"]: | ||||||
| 					accounts.append(account_name) | 					accounts.append(account_name) | ||||||
| @ -223,7 +222,7 @@ def build_tree_from_json(chart_template, chart_data=None, from_coa_importer=Fals | |||||||
| 	accounts = [] | 	accounts = [] | ||||||
| 	def _import_accounts(children, parent): | 	def _import_accounts(children, parent): | ||||||
| 		''' recursively called to form a parent-child based list of dict from chart template ''' | 		''' recursively called to form a parent-child based list of dict from chart template ''' | ||||||
| 		for account_name, child in iteritems(children): | 		for account_name, child in children.items(): | ||||||
| 			account = {} | 			account = {} | ||||||
| 			if account_name in ["account_name", "account_number", "account_type",\ | 			if account_name in ["account_name", "account_number", "account_type",\ | ||||||
| 				"root_type", "is_group", "tax_rate"]: continue | 				"root_type", "is_group", "tax_rate"]: continue | ||||||
|  | |||||||
| @ -12,7 +12,6 @@ from xml.etree import ElementTree as ET | |||||||
| 
 | 
 | ||||||
| import frappe | import frappe | ||||||
| from frappe.utils.csvutils import read_csv_content | from frappe.utils.csvutils import read_csv_content | ||||||
| from six import iteritems |  | ||||||
| 
 | 
 | ||||||
| path = "/Users/nabinhait/projects/odoo/addons" | path = "/Users/nabinhait/projects/odoo/addons" | ||||||
| 
 | 
 | ||||||
| @ -139,7 +138,7 @@ def get_account_types(root_list, csv_content, prefix=None): | |||||||
| 
 | 
 | ||||||
| def make_maps_for_xml(xml_roots, account_types, country_dir): | def make_maps_for_xml(xml_roots, account_types, country_dir): | ||||||
| 	"""make maps for `charts` and `accounts`""" | 	"""make maps for `charts` and `accounts`""" | ||||||
| 	for model, root_list in iteritems(xml_roots): | 	for model, root_list in xml_roots.items(): | ||||||
| 		for root in root_list: | 		for root in root_list: | ||||||
| 			for node in root[0].findall("record"): | 			for node in root[0].findall("record"): | ||||||
| 				if node.get("model")=="account.account.template": | 				if node.get("model")=="account.account.template": | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| import unittest | import unittest | ||||||
| 
 | 
 | ||||||
| import frappe | import frappe | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| from frappe import _ | from frappe import _ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| from frappe import _ | from frappe import _ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -15,7 +15,6 @@ from frappe.utils.background_jobs import enqueue | |||||||
| from frappe.utils.xlsxutils import ILLEGAL_CHARACTERS_RE, handle_html | from frappe.utils.xlsxutils import ILLEGAL_CHARACTERS_RE, handle_html | ||||||
| from openpyxl.styles import Font | from openpyxl.styles import Font | ||||||
| from openpyxl.utils import get_column_letter | from openpyxl.utils import get_column_letter | ||||||
| from six import string_types |  | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| class BankStatementImport(DataImport): | class BankStatementImport(DataImport): | ||||||
| @ -179,12 +178,12 @@ def write_xlsx(data, sheet_name, wb=None, column_widths=None, file_path=None): | |||||||
| 	for row in data: | 	for row in data: | ||||||
| 		clean_row = [] | 		clean_row = [] | ||||||
| 		for item in row: | 		for item in row: | ||||||
| 			if isinstance(item, string_types) and (sheet_name not in ['Data Import Template', 'Data Export']): | 			if isinstance(item, str) and (sheet_name not in ['Data Import Template', 'Data Export']): | ||||||
| 				value = handle_html(item) | 				value = handle_html(item) | ||||||
| 			else: | 			else: | ||||||
| 				value = item | 				value = item | ||||||
| 
 | 
 | ||||||
| 			if isinstance(item, string_types) and next(ILLEGAL_CHARACTERS_RE.finditer(value), None): | 			if isinstance(item, str) and next(ILLEGAL_CHARACTERS_RE.finditer(value), None): | ||||||
| 				# Remove illegal characters from the string | 				# Remove illegal characters from the string | ||||||
| 				value = re.sub(ILLEGAL_CHARACTERS_RE, '', value) | 				value = re.sub(ILLEGAL_CHARACTERS_RE, '', value) | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -7,7 +7,6 @@ import json | |||||||
| import frappe | import frappe | ||||||
| from frappe.utils import getdate | from frappe.utils import getdate | ||||||
| from frappe.utils.dateutils import parse_date | from frappe.utils.dateutils import parse_date | ||||||
| from six import iteritems |  | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @frappe.whitelist() | @frappe.whitelist() | ||||||
| @ -43,7 +42,7 @@ def create_bank_entries(columns, data, bank_account): | |||||||
| 		if all(item is None for item in d) is True: | 		if all(item is None for item in d) is True: | ||||||
| 			continue | 			continue | ||||||
| 		fields = {} | 		fields = {} | ||||||
| 		for key, value in iteritems(header_map): | 		for key, value in header_map.items(): | ||||||
| 			fields.update({key: d[int(value)-1]}) | 			fields.update({key: d[int(value)-1]}) | ||||||
| 
 | 
 | ||||||
| 		try: | 		try: | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| DEFAULT_MAPPERS = [ | DEFAULT_MAPPERS = [ | ||||||
|     { |     { | ||||||
|         'doctype': 'Cash Flow Mapper', |         'doctype': 'Cash Flow Mapper', | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| from frappe import _ | from frappe import _ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -6,7 +6,6 @@ import json | |||||||
| 
 | 
 | ||||||
| import frappe | import frappe | ||||||
| from frappe.utils import cint, flt, getdate | from frappe.utils import cint, flt, getdate | ||||||
| from six import string_types |  | ||||||
| 
 | 
 | ||||||
| from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( | from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( | ||||||
| 	get_accounting_dimensions, | 	get_accounting_dimensions, | ||||||
| @ -108,7 +107,7 @@ def calculate_interest_and_amount(outstanding_amount, rate_of_interest, dunning_ | |||||||
| 
 | 
 | ||||||
| @frappe.whitelist() | @frappe.whitelist() | ||||||
| def get_dunning_letter_text(dunning_type, doc, language=None): | def get_dunning_letter_text(dunning_type, doc, language=None): | ||||||
| 	if isinstance(doc, string_types): | 	if isinstance(doc, str): | ||||||
| 		doc = json.loads(doc) | 		doc = json.loads(doc) | ||||||
| 	if language: | 	if language: | ||||||
| 		filters = {'parent': dunning_type, 'language': language} | 		filters = {'parent': dunning_type, 'language': language} | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| from frappe import _ | from frappe import _ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,5 +1,3 @@ | |||||||
| 
 |  | ||||||
| 
 |  | ||||||
| def get_data(): | def get_data(): | ||||||
| 	return { | 	return { | ||||||
| 		'fieldname': 'reference_name', | 		'fieldname': 'reference_name', | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| from frappe import _ | from frappe import _ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| from frappe import _ | from frappe import _ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -8,7 +8,6 @@ from frappe.model.document import Document | |||||||
| from frappe.model.meta import get_field_precision | from frappe.model.meta import get_field_precision | ||||||
| from frappe.model.naming import set_name_from_naming_options | from frappe.model.naming import set_name_from_naming_options | ||||||
| from frappe.utils import flt, fmt_money | from frappe.utils import flt, fmt_money | ||||||
| from six import iteritems |  | ||||||
| 
 | 
 | ||||||
| import erpnext | import erpnext | ||||||
| from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( | from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( | ||||||
| @ -115,7 +114,7 @@ class GLEntry(Document): | |||||||
| 
 | 
 | ||||||
| 	def validate_allowed_dimensions(self): | 	def validate_allowed_dimensions(self): | ||||||
| 		dimension_filter_map = get_dimension_filter_map() | 		dimension_filter_map = get_dimension_filter_map() | ||||||
| 		for key, value in iteritems(dimension_filter_map): | 		for key, value in dimension_filter_map.items(): | ||||||
| 			dimension = key[0] | 			dimension = key[0] | ||||||
| 			account = key[1] | 			account = key[1] | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| from frappe import _ | from frappe import _ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| from frappe import _ | from frappe import _ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -7,7 +7,6 @@ import json | |||||||
| import frappe | import frappe | ||||||
| from frappe import _, msgprint, scrub | from frappe import _, msgprint, scrub | ||||||
| from frappe.utils import cint, cstr, flt, fmt_money, formatdate, get_link_to_form, nowdate | from frappe.utils import cint, cstr, flt, fmt_money, formatdate, get_link_to_form, nowdate | ||||||
| from six import iteritems, string_types |  | ||||||
| 
 | 
 | ||||||
| import erpnext | import erpnext | ||||||
| from erpnext.accounts.deferred_revenue import get_deferred_booking_accounts | from erpnext.accounts.deferred_revenue import get_deferred_booking_accounts | ||||||
| @ -116,7 +115,7 @@ class JournalEntry(AccountsController): | |||||||
| 				if d.reference_type in ("Sales Order", "Purchase Order", "Employee Advance"): | 				if d.reference_type in ("Sales Order", "Purchase Order", "Employee Advance"): | ||||||
| 					advance_paid.setdefault(d.reference_type, []).append(d.reference_name) | 					advance_paid.setdefault(d.reference_type, []).append(d.reference_name) | ||||||
| 
 | 
 | ||||||
| 		for voucher_type, order_list in iteritems(advance_paid): | 		for voucher_type, order_list in advance_paid.items(): | ||||||
| 			for voucher_no in list(set(order_list)): | 			for voucher_no in list(set(order_list)): | ||||||
| 				frappe.get_doc(voucher_type, voucher_no).set_total_advance_paid() | 				frappe.get_doc(voucher_type, voucher_no).set_total_advance_paid() | ||||||
| 
 | 
 | ||||||
| @ -431,7 +430,7 @@ class JournalEntry(AccountsController): | |||||||
| 
 | 
 | ||||||
| 	def validate_orders(self): | 	def validate_orders(self): | ||||||
| 		"""Validate totals, closed and docstatus for orders""" | 		"""Validate totals, closed and docstatus for orders""" | ||||||
| 		for reference_name, total in iteritems(self.reference_totals): | 		for reference_name, total in self.reference_totals.items(): | ||||||
| 			reference_type = self.reference_types[reference_name] | 			reference_type = self.reference_types[reference_name] | ||||||
| 			account = self.reference_accounts[reference_name] | 			account = self.reference_accounts[reference_name] | ||||||
| 
 | 
 | ||||||
| @ -462,7 +461,7 @@ class JournalEntry(AccountsController): | |||||||
| 
 | 
 | ||||||
| 	def validate_invoices(self): | 	def validate_invoices(self): | ||||||
| 		"""Validate totals and docstatus for invoices""" | 		"""Validate totals and docstatus for invoices""" | ||||||
| 		for reference_name, total in iteritems(self.reference_totals): | 		for reference_name, total in self.reference_totals.items(): | ||||||
| 			reference_type = self.reference_types[reference_name] | 			reference_type = self.reference_types[reference_name] | ||||||
| 
 | 
 | ||||||
| 			if (reference_type in ("Sales Invoice", "Purchase Invoice") and | 			if (reference_type in ("Sales Invoice", "Purchase Invoice") and | ||||||
| @ -1007,7 +1006,7 @@ def get_outstanding(args): | |||||||
| 	if not frappe.has_permission("Account"): | 	if not frappe.has_permission("Account"): | ||||||
| 		frappe.msgprint(_("No Permission"), raise_exception=1) | 		frappe.msgprint(_("No Permission"), raise_exception=1) | ||||||
| 
 | 
 | ||||||
| 	if isinstance(args, string_types): | 	if isinstance(args, str): | ||||||
| 		args = json.loads(args) | 		args = json.loads(args) | ||||||
| 
 | 
 | ||||||
| 	company_currency = erpnext.get_company_currency(args.get("company")) | 	company_currency = erpnext.get_company_currency(args.get("company")) | ||||||
|  | |||||||
| @ -1,5 +1,3 @@ | |||||||
| 
 |  | ||||||
| 
 |  | ||||||
| def get_data(): | def get_data(): | ||||||
| 	return { | 	return { | ||||||
| 		'fieldname': 'loyalty_program', | 		'fieldname': 'loyalty_program', | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| from frappe import _ | from frappe import _ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -7,7 +7,6 @@ import json | |||||||
| import frappe | import frappe | ||||||
| from frappe import ValidationError, _, scrub, throw | from frappe import ValidationError, _, scrub, throw | ||||||
| from frappe.utils import cint, comma_or, flt, getdate, nowdate | from frappe.utils import cint, comma_or, flt, getdate, nowdate | ||||||
| from six import iteritems, string_types |  | ||||||
| 
 | 
 | ||||||
| import erpnext | import erpnext | ||||||
| from erpnext.accounts.doctype.bank_account.bank_account import ( | from erpnext.accounts.doctype.bank_account.bank_account import ( | ||||||
| @ -203,7 +202,7 @@ class PaymentEntry(AccountsController): | |||||||
| 				ref_details = get_reference_details(d.reference_doctype, | 				ref_details = get_reference_details(d.reference_doctype, | ||||||
| 					d.reference_name, self.party_account_currency) | 					d.reference_name, self.party_account_currency) | ||||||
| 
 | 
 | ||||||
| 				for field, value in iteritems(ref_details): | 				for field, value in ref_details.items(): | ||||||
| 					if d.exchange_gain_loss: | 					if d.exchange_gain_loss: | ||||||
| 						# for cases where gain/loss is booked into invoice | 						# for cases where gain/loss is booked into invoice | ||||||
| 						# exchange_gain_loss is calculated from invoice & populated | 						# exchange_gain_loss is calculated from invoice & populated | ||||||
| @ -387,7 +386,7 @@ class PaymentEntry(AccountsController): | |||||||
| 						invoice_paid_amount_map[invoice_key]['outstanding'] = term.outstanding | 						invoice_paid_amount_map[invoice_key]['outstanding'] = term.outstanding | ||||||
| 						invoice_paid_amount_map[invoice_key]['discounted_amt'] = ref.total_amount * (term.discount / 100) | 						invoice_paid_amount_map[invoice_key]['discounted_amt'] = ref.total_amount * (term.discount / 100) | ||||||
| 
 | 
 | ||||||
| 		for idx, (key, allocated_amount) in enumerate(iteritems(invoice_payment_amount_map), 1): | 		for idx, (key, allocated_amount) in enumerate(invoice_payment_amount_map.items(), 1): | ||||||
| 			if not invoice_paid_amount_map.get(key): | 			if not invoice_paid_amount_map.get(key): | ||||||
| 				frappe.throw(_('Payment term {0} not used in {1}').format(key[0], key[1])) | 				frappe.throw(_('Payment term {0} not used in {1}').format(key[0], key[1])) | ||||||
| 
 | 
 | ||||||
| @ -912,7 +911,7 @@ class PaymentEntry(AccountsController): | |||||||
| 		self.paid_amount_after_tax = self.paid_amount | 		self.paid_amount_after_tax = self.paid_amount | ||||||
| 
 | 
 | ||||||
| 	def determine_exclusive_rate(self): | 	def determine_exclusive_rate(self): | ||||||
| 		if not any((cint(tax.included_in_paid_amount) for tax in self.get("taxes"))): | 		if not any(cint(tax.included_in_paid_amount) for tax in self.get("taxes")): | ||||||
| 			return | 			return | ||||||
| 
 | 
 | ||||||
| 		cumulated_tax_fraction = 0 | 		cumulated_tax_fraction = 0 | ||||||
| @ -1032,7 +1031,7 @@ def validate_inclusive_tax(tax, doc): | |||||||
| @frappe.whitelist() | @frappe.whitelist() | ||||||
| def get_outstanding_reference_documents(args): | def get_outstanding_reference_documents(args): | ||||||
| 
 | 
 | ||||||
| 	if isinstance(args, string_types): | 	if isinstance(args, str): | ||||||
| 		args = json.loads(args) | 		args = json.loads(args) | ||||||
| 
 | 
 | ||||||
| 	if args.get('party_type') == 'Member': | 	if args.get('party_type') == 'Member': | ||||||
|  | |||||||
| @ -1,5 +1,3 @@ | |||||||
| 
 |  | ||||||
| 
 |  | ||||||
| def get_data(): | def get_data(): | ||||||
| 	return { | 	return { | ||||||
| 		'fieldname': 'payment_gateway_account', | 		'fieldname': 'payment_gateway_account', | ||||||
|  | |||||||
| @ -1,5 +1,3 @@ | |||||||
| 
 |  | ||||||
| 
 |  | ||||||
| def get_data(): | def get_data(): | ||||||
| 	return { | 	return { | ||||||
| 		'fieldname': 'payment_order', | 		'fieldname': 'payment_order', | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| from frappe import _ | from frappe import _ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| from frappe import _ | from frappe import _ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -5,7 +5,6 @@ | |||||||
| import frappe | import frappe | ||||||
| from frappe import _ | from frappe import _ | ||||||
| from frappe.utils import cint, flt, get_link_to_form, getdate, nowdate | from frappe.utils import cint, flt, get_link_to_form, getdate, nowdate | ||||||
| from six import iteritems |  | ||||||
| 
 | 
 | ||||||
| from erpnext.accounts.doctype.loyalty_program.loyalty_program import validate_loyalty_points | from erpnext.accounts.doctype.loyalty_program.loyalty_program import validate_loyalty_points | ||||||
| from erpnext.accounts.doctype.payment_request.payment_request import make_payment_request | from erpnext.accounts.doctype.payment_request.payment_request import make_payment_request | ||||||
| @ -364,7 +363,7 @@ class POSInvoice(SalesInvoice): | |||||||
| 			for item in self.get("items"): | 			for item in self.get("items"): | ||||||
| 				if item.get('item_code'): | 				if item.get('item_code'): | ||||||
| 					profile_details = get_pos_profile_item_details(profile.get("company"), frappe._dict(item.as_dict()), profile) | 					profile_details = get_pos_profile_item_details(profile.get("company"), frappe._dict(item.as_dict()), profile) | ||||||
| 					for fname, val in iteritems(profile_details): | 					for fname, val in profile_details.items(): | ||||||
| 						if (not for_validate) or (for_validate and not item.get(fname)): | 						if (not for_validate) or (for_validate and not item.get(fname)): | ||||||
| 							item.set(fname, val) | 							item.set(fname, val) | ||||||
| 
 | 
 | ||||||
| @ -524,9 +523,8 @@ def make_sales_return(source_name, target_doc=None): | |||||||
| def make_merge_log(invoices): | def make_merge_log(invoices): | ||||||
| 	import json | 	import json | ||||||
| 
 | 
 | ||||||
| 	from six import string_types |  | ||||||
| 
 | 
 | ||||||
| 	if isinstance(invoices, string_types): | 	if isinstance(invoices, str): | ||||||
| 		invoices = json.loads(invoices) | 		invoices = json.loads(invoices) | ||||||
| 
 | 
 | ||||||
| 	if len(invoices) == 0: | 	if len(invoices) == 0: | ||||||
|  | |||||||
| @ -5,7 +5,6 @@ | |||||||
| import json | import json | ||||||
| 
 | 
 | ||||||
| import frappe | import frappe | ||||||
| import six |  | ||||||
| from frappe import _ | from frappe import _ | ||||||
| from frappe.core.page.background_jobs.background_jobs import get_info | from frappe.core.page.background_jobs.background_jobs import get_info | ||||||
| from frappe.model.document import Document | from frappe.model.document import Document | ||||||
| @ -282,7 +281,7 @@ def unconsolidate_pos_invoices(closing_entry): | |||||||
| 
 | 
 | ||||||
| def create_merge_logs(invoice_by_customer, closing_entry=None): | def create_merge_logs(invoice_by_customer, closing_entry=None): | ||||||
| 	try: | 	try: | ||||||
| 		for customer, invoices in six.iteritems(invoice_by_customer): | 		for customer, invoices in invoice_by_customer.items(): | ||||||
| 			merge_log = frappe.new_doc('POS Invoice Merge Log') | 			merge_log = frappe.new_doc('POS Invoice Merge Log') | ||||||
| 			merge_log.posting_date = getdate(closing_entry.get('posting_date')) if closing_entry else nowdate() | 			merge_log.posting_date = getdate(closing_entry.get('posting_date')) if closing_entry else nowdate() | ||||||
| 			merge_log.customer = customer | 			merge_log.customer = customer | ||||||
|  | |||||||
| @ -6,7 +6,6 @@ import frappe | |||||||
| from frappe import _, msgprint | from frappe import _, msgprint | ||||||
| from frappe.model.document import Document | from frappe.model.document import Document | ||||||
| from frappe.utils import get_link_to_form, now | from frappe.utils import get_link_to_form, now | ||||||
| from six import iteritems |  | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| class POSProfile(Document): | class POSProfile(Document): | ||||||
| @ -37,7 +36,7 @@ class POSProfile(Document): | |||||||
| 			self.expense_account], "Cost Center": [self.cost_center], | 			self.expense_account], "Cost Center": [self.cost_center], | ||||||
| 			"Warehouse": [self.warehouse]} | 			"Warehouse": [self.warehouse]} | ||||||
| 
 | 
 | ||||||
| 		for link_dt, dn_list in iteritems(accounts): | 		for link_dt, dn_list in accounts.items(): | ||||||
| 			for link_dn in dn_list: | 			for link_dn in dn_list: | ||||||
| 				if link_dn and not frappe.db.exists({"doctype": link_dt, | 				if link_dn and not frappe.db.exists({"doctype": link_dt, | ||||||
| 						"company": self.company, "name": link_dn}): | 						"company": self.company, "name": link_dn}): | ||||||
|  | |||||||
| @ -11,7 +11,6 @@ import frappe | |||||||
| from frappe import _, throw | from frappe import _, throw | ||||||
| from frappe.model.document import Document | from frappe.model.document import Document | ||||||
| from frappe.utils import cint, flt, getdate | from frappe.utils import cint, flt, getdate | ||||||
| from six import string_types |  | ||||||
| 
 | 
 | ||||||
| apply_on_dict = {"Item Code": "items", | apply_on_dict = {"Item Code": "items", | ||||||
| 	"Item Group": "item_groups", "Brand": "brands"} | 	"Item Group": "item_groups", "Brand": "brands"} | ||||||
| @ -178,7 +177,7 @@ def apply_pricing_rule(args, doc=None): | |||||||
| 		} | 		} | ||||||
| 	""" | 	""" | ||||||
| 
 | 
 | ||||||
| 	if isinstance(args, string_types): | 	if isinstance(args, str): | ||||||
| 		args = json.loads(args) | 		args = json.loads(args) | ||||||
| 
 | 
 | ||||||
| 	args = frappe._dict(args) | 	args = frappe._dict(args) | ||||||
| @ -234,7 +233,7 @@ def get_pricing_rule_for_item(args, price_list_rate=0, doc=None, for_validate=Fa | |||||||
| 		get_product_discount_rule, | 		get_product_discount_rule, | ||||||
| 	) | 	) | ||||||
| 
 | 
 | ||||||
| 	if isinstance(doc, string_types): | 	if isinstance(doc, str): | ||||||
| 		doc = json.loads(doc) | 		doc = json.loads(doc) | ||||||
| 
 | 
 | ||||||
| 	if doc: | 	if doc: | ||||||
| @ -270,7 +269,7 @@ def get_pricing_rule_for_item(args, price_list_rate=0, doc=None, for_validate=Fa | |||||||
| 		for pricing_rule in pricing_rules: | 		for pricing_rule in pricing_rules: | ||||||
| 			if not pricing_rule: continue | 			if not pricing_rule: continue | ||||||
| 
 | 
 | ||||||
| 			if isinstance(pricing_rule, string_types): | 			if isinstance(pricing_rule, str): | ||||||
| 				pricing_rule = frappe.get_cached_doc("Pricing Rule", pricing_rule) | 				pricing_rule = frappe.get_cached_doc("Pricing Rule", pricing_rule) | ||||||
| 				pricing_rule.apply_rule_on_other_items = get_pricing_rule_items(pricing_rule) | 				pricing_rule.apply_rule_on_other_items = get_pricing_rule_items(pricing_rule) | ||||||
| 
 | 
 | ||||||
| @ -427,7 +426,7 @@ def remove_pricing_rule_for_item(pricing_rules, item_details, item_code=None): | |||||||
| 
 | 
 | ||||||
| @frappe.whitelist() | @frappe.whitelist() | ||||||
| def remove_pricing_rules(item_list): | def remove_pricing_rules(item_list): | ||||||
| 	if isinstance(item_list, string_types): | 	if isinstance(item_list, str): | ||||||
| 		item_list = json.loads(item_list) | 		item_list = json.loads(item_list) | ||||||
| 
 | 
 | ||||||
| 	out = [] | 	out = [] | ||||||
|  | |||||||
| @ -6,7 +6,6 @@ import frappe | |||||||
| from frappe import _, throw | from frappe import _, throw | ||||||
| from frappe.model.mapper import get_mapped_doc | from frappe.model.mapper import get_mapped_doc | ||||||
| from frappe.utils import cint, cstr, flt, formatdate, get_link_to_form, getdate, nowdate | from frappe.utils import cint, cstr, flt, formatdate, get_link_to_form, getdate, nowdate | ||||||
| from six import iteritems |  | ||||||
| 
 | 
 | ||||||
| import erpnext | import erpnext | ||||||
| from erpnext.accounts.deferred_revenue import validate_service_stop_date | from erpnext.accounts.deferred_revenue import validate_service_stop_date | ||||||
| @ -600,7 +599,7 @@ class PurchaseInvoice(BuyingController): | |||||||
| 
 | 
 | ||||||
| 					# Amount added through landed-cost-voucher | 					# Amount added through landed-cost-voucher | ||||||
| 					if landed_cost_entries: | 					if landed_cost_entries: | ||||||
| 						for account, amount in iteritems(landed_cost_entries[(item.item_code, item.name)]): | 						for account, amount in landed_cost_entries[(item.item_code, item.name)].items(): | ||||||
| 							gl_entries.append(self.get_gl_dict({ | 							gl_entries.append(self.get_gl_dict({ | ||||||
| 								"account": account, | 								"account": account, | ||||||
| 								"against": item.expense_account, | 								"against": item.expense_account, | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| from frappe import _ | from frappe import _ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| from frappe import _ | from frappe import _ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -18,7 +18,6 @@ from frappe.utils import ( | |||||||
| 	getdate, | 	getdate, | ||||||
| 	nowdate, | 	nowdate, | ||||||
| ) | ) | ||||||
| from six import iteritems |  | ||||||
| 
 | 
 | ||||||
| import erpnext | import erpnext | ||||||
| from erpnext.accounts.deferred_revenue import validate_service_stop_date | from erpnext.accounts.deferred_revenue import validate_service_stop_date | ||||||
| @ -533,7 +532,7 @@ class SalesInvoice(SellingController): | |||||||
| 			for item in self.get("items"): | 			for item in self.get("items"): | ||||||
| 				if item.get('item_code'): | 				if item.get('item_code'): | ||||||
| 					profile_details = get_pos_profile_item_details(pos, frappe._dict(item.as_dict()), pos, update_data=True) | 					profile_details = get_pos_profile_item_details(pos, frappe._dict(item.as_dict()), pos, update_data=True) | ||||||
| 					for fname, val in iteritems(profile_details): | 					for fname, val in profile_details.items(): | ||||||
| 						if (not for_validate) or (for_validate and not item.get(fname)): | 						if (not for_validate) or (for_validate and not item.get(fname)): | ||||||
| 							item.set(fname, val) | 							item.set(fname, val) | ||||||
| 
 | 
 | ||||||
| @ -639,7 +638,7 @@ class SalesInvoice(SellingController): | |||||||
| 			return | 			return | ||||||
| 
 | 
 | ||||||
| 		prev_doc_field_map = {'Sales Order': ['so_required', 'is_pos'],'Delivery Note': ['dn_required', 'update_stock']} | 		prev_doc_field_map = {'Sales Order': ['so_required', 'is_pos'],'Delivery Note': ['dn_required', 'update_stock']} | ||||||
| 		for key, value in iteritems(prev_doc_field_map): | 		for key, value in prev_doc_field_map.items(): | ||||||
| 			if frappe.db.get_single_value('Selling Settings', value[0]) == 'Yes': | 			if frappe.db.get_single_value('Selling Settings', value[0]) == 'Yes': | ||||||
| 
 | 
 | ||||||
| 				if frappe.get_value('Customer', self.customer, value[0]): | 				if frappe.get_value('Customer', self.customer, value[0]): | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| from frappe import _ | from frappe import _ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -8,7 +8,6 @@ import frappe | |||||||
| from frappe.model.dynamic_links import get_dynamic_link_map | from frappe.model.dynamic_links import get_dynamic_link_map | ||||||
| from frappe.model.naming import make_autoname | from frappe.model.naming import make_autoname | ||||||
| from frappe.utils import add_days, flt, getdate, nowdate | from frappe.utils import add_days, flt, getdate, nowdate | ||||||
| from six import iteritems |  | ||||||
| 
 | 
 | ||||||
| import erpnext | import erpnext | ||||||
| from erpnext.accounts.doctype.account.test_account import create_account, get_inventory_account | from erpnext.accounts.doctype.account.test_account import create_account, get_inventory_account | ||||||
| @ -345,7 +344,7 @@ class TestSalesInvoice(unittest.TestCase): | |||||||
| 
 | 
 | ||||||
| 		# check if item values are calculated | 		# check if item values are calculated | ||||||
| 		for i, d in enumerate(si.get("items")): | 		for i, d in enumerate(si.get("items")): | ||||||
| 			for k, v in iteritems(expected_values[i]): | 			for k, v in expected_values[i].items(): | ||||||
| 				self.assertEqual(d.get(k), v) | 				self.assertEqual(d.get(k), v) | ||||||
| 
 | 
 | ||||||
| 		# check net total | 		# check net total | ||||||
| @ -648,7 +647,7 @@ class TestSalesInvoice(unittest.TestCase): | |||||||
| 
 | 
 | ||||||
| 		# check if item values are calculated | 		# check if item values are calculated | ||||||
| 		for i, d in enumerate(si.get("items")): | 		for i, d in enumerate(si.get("items")): | ||||||
| 			for key, val in iteritems(expected_values[i]): | 			for key, val in expected_values[i].items(): | ||||||
| 				self.assertEqual(d.get(key), val) | 				self.assertEqual(d.get(key), val) | ||||||
| 
 | 
 | ||||||
| 		# check net total | 		# check net total | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| from frappe import _ | from frappe import _ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| from frappe import _ | from frappe import _ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,5 +1,3 @@ | |||||||
| 
 |  | ||||||
| 
 |  | ||||||
| def get_data(): | def get_data(): | ||||||
| 	return { | 	return { | ||||||
| 		'fieldname': 'shareholder', | 		'fieldname': 'shareholder', | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| from frappe import _ | from frappe import _ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors | # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors | ||||||
| # For license information, please see license.txt | # For license information, please see license.txt | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| from frappe import _ | from frappe import _ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| from frappe import _ | from frappe import _ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -10,7 +10,6 @@ from frappe.contacts.doctype.address.address import get_default_address | |||||||
| from frappe.model.document import Document | from frappe.model.document import Document | ||||||
| from frappe.utils import cint, cstr | from frappe.utils import cint, cstr | ||||||
| from frappe.utils.nestedset import get_root_of | from frappe.utils.nestedset import get_root_of | ||||||
| from six import iteritems |  | ||||||
| 
 | 
 | ||||||
| from erpnext.setup.doctype.customer_group.customer_group import get_parent_customer_groups | from erpnext.setup.doctype.customer_group.customer_group import get_parent_customer_groups | ||||||
| 
 | 
 | ||||||
| @ -148,7 +147,7 @@ def get_tax_template(posting_date, args): | |||||||
| 	if 'tax_category' in args.keys(): | 	if 'tax_category' in args.keys(): | ||||||
| 		del args['tax_category'] | 		del args['tax_category'] | ||||||
| 
 | 
 | ||||||
| 	for key, value in iteritems(args): | 	for key, value in args.items(): | ||||||
| 		if key=="use_for_shopping_cart": | 		if key=="use_for_shopping_cart": | ||||||
| 			conditions.append("use_for_shopping_cart = {0}".format(1 if value else 0)) | 			conditions.append("use_for_shopping_cart = {0}".format(1 if value else 0)) | ||||||
| 		elif key == 'customer_group': | 		elif key == 'customer_group': | ||||||
|  | |||||||
| @ -11,7 +11,6 @@ from erpnext.crm.doctype.opportunity.test_opportunity import make_opportunity | |||||||
| 
 | 
 | ||||||
| test_records = frappe.get_test_records('Tax Rule') | test_records = frappe.get_test_records('Tax Rule') | ||||||
| 
 | 
 | ||||||
| from six import iteritems |  | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| class TestTaxRule(unittest.TestCase): | class TestTaxRule(unittest.TestCase): | ||||||
| @ -175,7 +174,7 @@ def make_tax_rule(**args): | |||||||
| 
 | 
 | ||||||
| 	tax_rule = frappe.new_doc("Tax Rule") | 	tax_rule = frappe.new_doc("Tax Rule") | ||||||
| 
 | 
 | ||||||
| 	for key, val in iteritems(args): | 	for key, val in args.items(): | ||||||
| 		if key != "save": | 		if key != "save": | ||||||
| 			tax_rule.set(key, val) | 			tax_rule.set(key, val) | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -378,7 +378,7 @@ def get_tcs_amount(parties, inv, tax_details, vouchers, adv_vouchers): | |||||||
| 	current_invoice_total = get_invoice_total_without_tcs(inv, tax_details) | 	current_invoice_total = get_invoice_total_without_tcs(inv, tax_details) | ||||||
| 	total_invoiced_amt = current_invoice_total + invoiced_amt + advance_amt - credit_note_amt | 	total_invoiced_amt = current_invoice_total + invoiced_amt + advance_amt - credit_note_amt | ||||||
| 
 | 
 | ||||||
| 	if ((cumulative_threshold and total_invoiced_amt >= cumulative_threshold)): | 	if (cumulative_threshold and total_invoiced_amt >= cumulative_threshold): | ||||||
| 		chargeable_amt = total_invoiced_amt - cumulative_threshold | 		chargeable_amt = total_invoiced_amt - cumulative_threshold | ||||||
| 		tcs_amount = chargeable_amt * tax_details.rate / 100 if chargeable_amt > 0 else 0 | 		tcs_amount = chargeable_amt * tax_details.rate / 100 if chargeable_amt > 0 else 0 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,5 +1,3 @@ | |||||||
| 
 |  | ||||||
| 
 |  | ||||||
| def get_data(): | def get_data(): | ||||||
| 	return { | 	return { | ||||||
| 		'fieldname': 'tax_withholding_category', | 		'fieldname': 'tax_withholding_category', | ||||||
|  | |||||||
| @ -1,5 +1,3 @@ | |||||||
| 
 |  | ||||||
| 
 |  | ||||||
| def get_context(context): | def get_context(context): | ||||||
| 	# do your magic here | 	# do your magic here | ||||||
| 	pass | 	pass | ||||||
|  | |||||||
| @ -26,7 +26,6 @@ from frappe.utils import ( | |||||||
| 	getdate, | 	getdate, | ||||||
| 	nowdate, | 	nowdate, | ||||||
| ) | ) | ||||||
| from six import iteritems |  | ||||||
| 
 | 
 | ||||||
| import erpnext | import erpnext | ||||||
| from erpnext import get_company_currency | from erpnext import get_company_currency | ||||||
| @ -508,7 +507,7 @@ def get_timeline_data(doctype, name): | |||||||
| 
 | 
 | ||||||
| 	timeline_items = dict(data) | 	timeline_items = dict(data) | ||||||
| 
 | 
 | ||||||
| 	for date, count in iteritems(timeline_items): | 	for date, count in timeline_items.items(): | ||||||
| 		timestamp = get_timestamp(date) | 		timestamp = get_timestamp(date) | ||||||
| 		out.update({ timestamp: count }) | 		out.update({ timestamp: count }) | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| import unittest | import unittest | ||||||
| 
 | 
 | ||||||
| import frappe | import frappe | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| import unittest | import unittest | ||||||
| 
 | 
 | ||||||
| import frappe | import frappe | ||||||
|  | |||||||
| @ -5,7 +5,6 @@ | |||||||
| import frappe | import frappe | ||||||
| from frappe import _, scrub | from frappe import _, scrub | ||||||
| from frappe.utils import cint | from frappe.utils import cint | ||||||
| from six import iteritems |  | ||||||
| 
 | 
 | ||||||
| from erpnext.accounts.party import get_partywise_advanced_payment_amount | from erpnext.accounts.party import get_partywise_advanced_payment_amount | ||||||
| from erpnext.accounts.report.accounts_receivable.accounts_receivable import ReceivablePayableReport | from erpnext.accounts.report.accounts_receivable.accounts_receivable import ReceivablePayableReport | ||||||
| @ -37,7 +36,7 @@ class AccountsReceivableSummary(ReceivablePayableReport): | |||||||
| 		party_advance_amount = get_partywise_advanced_payment_amount(self.party_type, | 		party_advance_amount = get_partywise_advanced_payment_amount(self.party_type, | ||||||
| 			self.filters.report_date, self.filters.show_future_payments, self.filters.company) or {} | 			self.filters.report_date, self.filters.show_future_payments, self.filters.company) or {} | ||||||
| 
 | 
 | ||||||
| 		for party, party_dict in iteritems(self.party_total): | 		for party, party_dict in self.party_total.items(): | ||||||
| 			if party_dict.outstanding == 0: | 			if party_dict.outstanding == 0: | ||||||
| 				continue | 				continue | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -7,7 +7,6 @@ import datetime | |||||||
| import frappe | import frappe | ||||||
| from frappe import _ | from frappe import _ | ||||||
| from frappe.utils import flt, formatdate | from frappe.utils import flt, formatdate | ||||||
| from six import iteritems |  | ||||||
| 
 | 
 | ||||||
| from erpnext.controllers.trends import get_period_date_ranges, get_period_month_ranges | from erpnext.controllers.trends import get_period_date_ranges, get_period_month_ranges | ||||||
| 
 | 
 | ||||||
| @ -48,7 +47,7 @@ def execute(filters=None): | |||||||
| 	return columns, data, None, chart | 	return columns, data, None, chart | ||||||
| 
 | 
 | ||||||
| def get_final_data(dimension, dimension_items, filters, period_month_ranges, data, DCC_allocation): | def get_final_data(dimension, dimension_items, filters, period_month_ranges, data, DCC_allocation): | ||||||
| 	for account, monthwise_data in iteritems(dimension_items): | 	for account, monthwise_data in dimension_items.items(): | ||||||
| 		row = [dimension, account] | 		row = [dimension, account] | ||||||
| 		totals = [0, 0, 0] | 		totals = [0, 0, 0] | ||||||
| 		for year in get_fiscal_years(filters): | 		for year in get_fiscal_years(filters): | ||||||
|  | |||||||
| @ -5,7 +5,6 @@ | |||||||
| import frappe | import frappe | ||||||
| from frappe import _ | from frappe import _ | ||||||
| from frappe.utils import cint, cstr | from frappe.utils import cint, cstr | ||||||
| from six import iteritems |  | ||||||
| 
 | 
 | ||||||
| from erpnext.accounts.report.financial_statements import ( | from erpnext.accounts.report.financial_statements import ( | ||||||
| 	get_columns, | 	get_columns, | ||||||
| @ -201,7 +200,7 @@ def add_total_row_account(out, data, label, period_list, currency, summary_data, | |||||||
| def get_report_summary(summary_data, currency): | def get_report_summary(summary_data, currency): | ||||||
| 	report_summary = [] | 	report_summary = [] | ||||||
| 
 | 
 | ||||||
| 	for label, value in iteritems(summary_data): | 	for label, value in summary_data.items(): | ||||||
| 		report_summary.append( | 		report_summary.append( | ||||||
| 			{ | 			{ | ||||||
| 				"value": value, | 				"value": value, | ||||||
|  | |||||||
| @ -5,7 +5,6 @@ | |||||||
| import frappe | import frappe | ||||||
| from frappe import _, scrub | from frappe import _, scrub | ||||||
| from frappe.utils import getdate, nowdate | from frappe.utils import getdate, nowdate | ||||||
| from six import iteritems, itervalues |  | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| class PartyLedgerSummaryReport(object): | class PartyLedgerSummaryReport(object): | ||||||
| @ -143,9 +142,9 @@ class PartyLedgerSummaryReport(object): | |||||||
| 					self.party_data[gle.party].paid_amount -= amount | 					self.party_data[gle.party].paid_amount -= amount | ||||||
| 
 | 
 | ||||||
| 		out = [] | 		out = [] | ||||||
| 		for party, row in iteritems(self.party_data): | 		for party, row in self.party_data.items(): | ||||||
| 			if row.opening_balance or row.invoiced_amount or row.paid_amount or row.return_amount or row.closing_amount: | 			if row.opening_balance or row.invoiced_amount or row.paid_amount or row.return_amount or row.closing_amount: | ||||||
| 				total_party_adjustment = sum(amount for amount in itervalues(self.party_adjustment_details.get(party, {}))) | 				total_party_adjustment = sum(amount for amount in self.party_adjustment_details.get(party, {}).values()) | ||||||
| 				row.paid_amount -= total_party_adjustment | 				row.paid_amount -= total_party_adjustment | ||||||
| 
 | 
 | ||||||
| 				adjustments = self.party_adjustment_details.get(party, {}) | 				adjustments = self.party_adjustment_details.get(party, {}) | ||||||
| @ -267,7 +266,7 @@ class PartyLedgerSummaryReport(object): | |||||||
| 			adjustment_voucher_entries.setdefault((gle.voucher_type, gle.voucher_no), []) | 			adjustment_voucher_entries.setdefault((gle.voucher_type, gle.voucher_no), []) | ||||||
| 			adjustment_voucher_entries[(gle.voucher_type, gle.voucher_no)].append(gle) | 			adjustment_voucher_entries[(gle.voucher_type, gle.voucher_no)].append(gle) | ||||||
| 
 | 
 | ||||||
| 		for voucher_gl_entries in itervalues(adjustment_voucher_entries): | 		for voucher_gl_entries in adjustment_voucher_entries.values(): | ||||||
| 			parties = {} | 			parties = {} | ||||||
| 			accounts = {} | 			accounts = {} | ||||||
| 			has_irrelevant_entry = False | 			has_irrelevant_entry = False | ||||||
| @ -287,7 +286,7 @@ class PartyLedgerSummaryReport(object): | |||||||
| 			if parties and accounts: | 			if parties and accounts: | ||||||
| 				if len(parties) == 1: | 				if len(parties) == 1: | ||||||
| 					party = list(parties.keys())[0] | 					party = list(parties.keys())[0] | ||||||
| 					for account, amount in iteritems(accounts): | 					for account, amount in accounts.items(): | ||||||
| 						self.party_adjustment_accounts.add(account) | 						self.party_adjustment_accounts.add(account) | ||||||
| 						self.party_adjustment_details.setdefault(party, {}) | 						self.party_adjustment_details.setdefault(party, {}) | ||||||
| 						self.party_adjustment_details[party].setdefault(account, 0) | 						self.party_adjustment_details[party].setdefault(account, 0) | ||||||
| @ -295,7 +294,7 @@ class PartyLedgerSummaryReport(object): | |||||||
| 				elif len(accounts) == 1 and not has_irrelevant_entry: | 				elif len(accounts) == 1 and not has_irrelevant_entry: | ||||||
| 					account = list(accounts.keys())[0] | 					account = list(accounts.keys())[0] | ||||||
| 					self.party_adjustment_accounts.add(account) | 					self.party_adjustment_accounts.add(account) | ||||||
| 					for party, amount in iteritems(parties): | 					for party, amount in parties.items(): | ||||||
| 						self.party_adjustment_details.setdefault(party, {}) | 						self.party_adjustment_details.setdefault(party, {}) | ||||||
| 						self.party_adjustment_details[party].setdefault(account, 0) | 						self.party_adjustment_details[party].setdefault(account, 0) | ||||||
| 						self.party_adjustment_details[party][account] += amount | 						self.party_adjustment_details[party][account] += amount | ||||||
|  | |||||||
| @ -5,7 +5,6 @@ | |||||||
| import frappe | import frappe | ||||||
| from frappe import _ | from frappe import _ | ||||||
| from frappe.utils import cstr, flt | from frappe.utils import cstr, flt | ||||||
| from six import itervalues |  | ||||||
| 
 | 
 | ||||||
| import erpnext | import erpnext | ||||||
| from erpnext.accounts.report.financial_statements import ( | from erpnext.accounts.report.financial_statements import ( | ||||||
| @ -107,7 +106,7 @@ def set_gl_entries_by_account(dimension_items_list, filters, account, gl_entries | |||||||
| 
 | 
 | ||||||
| def format_gl_entries(gl_entries_by_account, accounts_by_name, dimension_items_list): | def format_gl_entries(gl_entries_by_account, accounts_by_name, dimension_items_list): | ||||||
| 
 | 
 | ||||||
| 	for entries in itervalues(gl_entries_by_account): | 	for entries in gl_entries_by_account.values(): | ||||||
| 		for entry in entries: | 		for entry in entries: | ||||||
| 			d = accounts_by_name.get(entry.account) | 			d = accounts_by_name.get(entry.account) | ||||||
| 			if not d: | 			if not d: | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | ||||||
| # License: GNU General Public License v3. See license.txt | # License: GNU General Public License v3. See license.txt | ||||||
| 
 | 
 | ||||||
| @ -10,7 +9,6 @@ import re | |||||||
| import frappe | import frappe | ||||||
| from frappe import _ | from frappe import _ | ||||||
| from frappe.utils import add_days, add_months, cint, cstr, flt, formatdate, get_first_day, getdate | from frappe.utils import add_days, add_months, cint, cstr, flt, formatdate, get_first_day, getdate | ||||||
| from six import itervalues |  | ||||||
| 
 | 
 | ||||||
| from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( | from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( | ||||||
| 	get_accounting_dimensions, | 	get_accounting_dimensions, | ||||||
| @ -188,7 +186,7 @@ def get_appropriate_currency(company, filters=None): | |||||||
| 
 | 
 | ||||||
| def calculate_values( | def calculate_values( | ||||||
| 		accounts_by_name, gl_entries_by_account, period_list, accumulated_values, ignore_accumulated_values_for_fy): | 		accounts_by_name, gl_entries_by_account, period_list, accumulated_values, ignore_accumulated_values_for_fy): | ||||||
| 	for entries in itervalues(gl_entries_by_account): | 	for entries in gl_entries_by_account.values(): | ||||||
| 		for entry in entries: | 		for entry in entries: | ||||||
| 			d = accounts_by_name.get(entry.account) | 			d = accounts_by_name.get(entry.account) | ||||||
| 			if not d: | 			if not d: | ||||||
|  | |||||||
| @ -7,7 +7,6 @@ from collections import OrderedDict | |||||||
| import frappe | import frappe | ||||||
| from frappe import _, _dict | from frappe import _, _dict | ||||||
| from frappe.utils import cstr, flt, getdate | from frappe.utils import cstr, flt, getdate | ||||||
| from six import iteritems |  | ||||||
| 
 | 
 | ||||||
| from erpnext import get_company_currency, get_default_company | from erpnext import get_company_currency, get_default_company | ||||||
| from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( | from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( | ||||||
| @ -314,7 +313,7 @@ def get_data_with_opening_closing(filters, account_details, accounting_dimension | |||||||
| 	data.append(totals.opening) | 	data.append(totals.opening) | ||||||
| 
 | 
 | ||||||
| 	if filters.get("group_by") != 'Group by Voucher (Consolidated)': | 	if filters.get("group_by") != 'Group by Voucher (Consolidated)': | ||||||
| 		for acc, acc_dict in iteritems(gle_map): | 		for acc, acc_dict in gle_map.items(): | ||||||
| 			# acc | 			# acc | ||||||
| 			if acc_dict.entries: | 			if acc_dict.entries: | ||||||
| 				# opening | 				# opening | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| import datetime | import datetime | ||||||
| import json | import json | ||||||
| import os | import os | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| import frappe | import frappe | ||||||
| from frappe import _ | from frappe import _ | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| import frappe | import frappe | ||||||
| from frappe.utils import flt, formatdate, get_datetime_str | from frappe.utils import flt, formatdate, get_datetime_str | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| import unittest | import unittest | ||||||
| 
 | 
 | ||||||
| from frappe.test_runner import make_test_objects | from frappe.test_runner import make_test_objects | ||||||
|  | |||||||
| @ -9,7 +9,6 @@ import frappe.defaults | |||||||
| from frappe import _, throw | from frappe import _, throw | ||||||
| from frappe.model.meta import get_field_precision | from frappe.model.meta import get_field_precision | ||||||
| from frappe.utils import cint, cstr, flt, formatdate, get_number_format_info, getdate, now, nowdate | from frappe.utils import cint, cstr, flt, formatdate, get_number_format_info, getdate, now, nowdate | ||||||
| from six import string_types |  | ||||||
| 
 | 
 | ||||||
| import erpnext | import erpnext | ||||||
| 
 | 
 | ||||||
| @ -795,7 +794,7 @@ def get_children(doctype, parent, company, is_root=False): | |||||||
| @frappe.whitelist() | @frappe.whitelist() | ||||||
| def get_account_balances(accounts, company): | def get_account_balances(accounts, company): | ||||||
| 
 | 
 | ||||||
| 	if isinstance(accounts, string_types): | 	if isinstance(accounts, str): | ||||||
| 		accounts = loads(accounts) | 		accounts = loads(accounts) | ||||||
| 
 | 
 | ||||||
| 	if not accounts: | 	if not accounts: | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| from frappe import _ | from frappe import _ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -20,7 +20,6 @@ from frappe.utils import ( | |||||||
| 	nowdate, | 	nowdate, | ||||||
| 	today, | 	today, | ||||||
| ) | ) | ||||||
| from six import string_types |  | ||||||
| 
 | 
 | ||||||
| import erpnext | import erpnext | ||||||
| from erpnext.accounts.general_ledger import make_reverse_gl_entries | from erpnext.accounts.general_ledger import make_reverse_gl_entries | ||||||
| @ -625,7 +624,7 @@ class Asset(AccountsController): | |||||||
| 
 | 
 | ||||||
| 	@frappe.whitelist() | 	@frappe.whitelist() | ||||||
| 	def get_depreciation_rate(self, args, on_validate=False): | 	def get_depreciation_rate(self, args, on_validate=False): | ||||||
| 		if isinstance(args, string_types): | 		if isinstance(args, str): | ||||||
| 			args = json.loads(args) | 			args = json.loads(args) | ||||||
| 
 | 
 | ||||||
| 		float_precision = cint(frappe.db.get_default("float_precision")) or 2 | 		float_precision = cint(frappe.db.get_default("float_precision")) or 2 | ||||||
| @ -820,9 +819,7 @@ def make_journal_entry(asset_name): | |||||||
| def make_asset_movement(assets, purpose=None): | def make_asset_movement(assets, purpose=None): | ||||||
| 	import json | 	import json | ||||||
| 
 | 
 | ||||||
| 	from six import string_types | 	if isinstance(assets, str): | ||||||
| 
 |  | ||||||
| 	if isinstance(assets, string_types): |  | ||||||
| 		assets = json.loads(assets) | 		assets = json.loads(assets) | ||||||
| 
 | 
 | ||||||
| 	if len(assets) == 0: | 	if len(assets) == 0: | ||||||
|  | |||||||
| @ -1,5 +1,3 @@ | |||||||
| 
 |  | ||||||
| 
 |  | ||||||
| def get_data(): | def get_data(): | ||||||
| 	return { | 	return { | ||||||
| 		'non_standard_fieldnames': { | 		'non_standard_fieldnames': { | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| from frappe import _ | from frappe import _ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -12,7 +12,6 @@ from frappe.model.mapper import get_mapped_doc | |||||||
| from frappe.utils import get_url | from frappe.utils import get_url | ||||||
| from frappe.utils.print_format import download_pdf | from frappe.utils.print_format import download_pdf | ||||||
| from frappe.utils.user import get_user_fullname | from frappe.utils.user import get_user_fullname | ||||||
| from six import string_types |  | ||||||
| 
 | 
 | ||||||
| from erpnext.accounts.party import get_party_account_currency, get_party_details | from erpnext.accounts.party import get_party_account_currency, get_party_details | ||||||
| from erpnext.buying.utils import validate_for_items | from erpnext.buying.utils import validate_for_items | ||||||
| @ -288,7 +287,7 @@ def make_supplier_quotation_from_rfq(source_name, target_doc=None, for_supplier= | |||||||
| # This method is used to make supplier quotation from supplier's portal. | # This method is used to make supplier quotation from supplier's portal. | ||||||
| @frappe.whitelist() | @frappe.whitelist() | ||||||
| def create_supplier_quotation(doc): | def create_supplier_quotation(doc): | ||||||
| 	if isinstance(doc, string_types): | 	if isinstance(doc, str): | ||||||
| 		doc = json.loads(doc) | 		doc = json.loads(doc) | ||||||
| 
 | 
 | ||||||
| 	try: | 	try: | ||||||
|  | |||||||
| @ -1,5 +1,3 @@ | |||||||
| 
 |  | ||||||
| 
 |  | ||||||
| def get_data(): | def get_data(): | ||||||
| 	return { | 	return { | ||||||
| 		'docstatus': 1, | 		'docstatus': 1, | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| from frappe import _ | from frappe import _ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| from frappe import _ | from frappe import _ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| from frappe import _ | from frappe import _ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| from frappe import _ | from frappe import _ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| from frappe import _ | from frappe import _ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -20,7 +20,6 @@ from frappe.utils import ( | |||||||
| 	nowdate, | 	nowdate, | ||||||
| 	today, | 	today, | ||||||
| ) | ) | ||||||
| from six import text_type |  | ||||||
| 
 | 
 | ||||||
| import erpnext | import erpnext | ||||||
| from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( | from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( | ||||||
| @ -1080,7 +1079,7 @@ class AccountsController(TransactionBase): | |||||||
| 			stock_items = [r[0] for r in frappe.db.sql(""" | 			stock_items = [r[0] for r in frappe.db.sql(""" | ||||||
| 				select name from `tabItem` | 				select name from `tabItem` | ||||||
| 				where name in (%s) and is_stock_item=1 | 				where name in (%s) and is_stock_item=1 | ||||||
| 			""" % (", ".join((["%s"] * len(item_codes))),), item_codes)] | 			""" % (", ".join(["%s"] * len(item_codes)),), item_codes)] | ||||||
| 
 | 
 | ||||||
| 		return stock_items | 		return stock_items | ||||||
| 
 | 
 | ||||||
| @ -1789,7 +1788,7 @@ def get_payment_terms(terms_template, posting_date=None, grand_total=None, base_ | |||||||
| @frappe.whitelist() | @frappe.whitelist() | ||||||
| def get_payment_term_details(term, posting_date=None, grand_total=None, base_grand_total=None, bill_date=None): | def get_payment_term_details(term, posting_date=None, grand_total=None, base_grand_total=None, bill_date=None): | ||||||
| 	term_details = frappe._dict() | 	term_details = frappe._dict() | ||||||
| 	if isinstance(term, text_type): | 	if isinstance(term, str): | ||||||
| 		term = frappe.get_doc("Payment Term", term) | 		term = frappe.get_doc("Payment Term", term) | ||||||
| 	else: | 	else: | ||||||
| 		term_details.payment_term = term.payment_term | 		term_details.payment_term = term.payment_term | ||||||
|  | |||||||
| @ -8,7 +8,6 @@ import json | |||||||
| import frappe | import frappe | ||||||
| from frappe import _ | from frappe import _ | ||||||
| from frappe.utils import cstr, flt | from frappe.utils import cstr, flt | ||||||
| from six import string_types |  | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| class ItemVariantExistsError(frappe.ValidationError): pass | class ItemVariantExistsError(frappe.ValidationError): pass | ||||||
| @ -30,7 +29,7 @@ def get_variant(template, args=None, variant=None, manufacturer=None, | |||||||
| 		return make_variant_based_on_manufacturer(item_template, manufacturer, | 		return make_variant_based_on_manufacturer(item_template, manufacturer, | ||||||
| 			manufacturer_part_no) | 			manufacturer_part_no) | ||||||
| 	else: | 	else: | ||||||
| 		if isinstance(args, string_types): | 		if isinstance(args, str): | ||||||
| 			args = json.loads(args) | 			args = json.loads(args) | ||||||
| 
 | 
 | ||||||
| 		if not args: | 		if not args: | ||||||
| @ -54,7 +53,7 @@ def make_variant_based_on_manufacturer(template, manufacturer, manufacturer_part | |||||||
| 	return variant | 	return variant | ||||||
| 
 | 
 | ||||||
| def validate_item_variant_attributes(item, args=None): | def validate_item_variant_attributes(item, args=None): | ||||||
| 	if isinstance(item, string_types): | 	if isinstance(item, str): | ||||||
| 		item = frappe.get_doc('Item', item) | 		item = frappe.get_doc('Item', item) | ||||||
| 
 | 
 | ||||||
| 	if not args: | 	if not args: | ||||||
| @ -156,7 +155,7 @@ def find_variant(template, args, variant_item_code=None): | |||||||
| 
 | 
 | ||||||
| @frappe.whitelist() | @frappe.whitelist() | ||||||
| def create_variant(item, args): | def create_variant(item, args): | ||||||
| 	if isinstance(args, string_types): | 	if isinstance(args, str): | ||||||
| 		args = json.loads(args) | 		args = json.loads(args) | ||||||
| 
 | 
 | ||||||
| 	template = frappe.get_doc("Item", item) | 	template = frappe.get_doc("Item", item) | ||||||
| @ -179,7 +178,7 @@ def create_variant(item, args): | |||||||
| @frappe.whitelist() | @frappe.whitelist() | ||||||
| def enqueue_multiple_variant_creation(item, args): | def enqueue_multiple_variant_creation(item, args): | ||||||
| 	# There can be innumerable attribute combinations, enqueue | 	# There can be innumerable attribute combinations, enqueue | ||||||
| 	if isinstance(args, string_types): | 	if isinstance(args, str): | ||||||
| 		variants = json.loads(args) | 		variants = json.loads(args) | ||||||
| 	total_variants = 1 | 	total_variants = 1 | ||||||
| 	for key in variants: | 	for key in variants: | ||||||
| @ -196,7 +195,7 @@ def enqueue_multiple_variant_creation(item, args): | |||||||
| 
 | 
 | ||||||
| def create_multiple_variants(item, args): | def create_multiple_variants(item, args): | ||||||
| 	count = 0 | 	count = 0 | ||||||
| 	if isinstance(args, string_types): | 	if isinstance(args, str): | ||||||
| 		args = json.loads(args) | 		args = json.loads(args) | ||||||
| 
 | 
 | ||||||
| 	args_set = generate_keyed_value_combinations(args) | 	args_set = generate_keyed_value_combinations(args) | ||||||
|  | |||||||
| @ -176,7 +176,7 @@ class calculate_taxes_and_totals(object): | |||||||
| 			self.doc.round_floats_in(tax) | 			self.doc.round_floats_in(tax) | ||||||
| 
 | 
 | ||||||
| 	def determine_exclusive_rate(self): | 	def determine_exclusive_rate(self): | ||||||
| 		if not any((cint(tax.included_in_print_rate) for tax in self.doc.get("taxes"))): | 		if not any(cint(tax.included_in_print_rate) for tax in self.doc.get("taxes")): | ||||||
| 			return | 			return | ||||||
| 
 | 
 | ||||||
| 		for item in self.doc.get("items"): | 		for item in self.doc.get("items"): | ||||||
|  | |||||||
| @ -1,9 +1,7 @@ | |||||||
| 
 |  | ||||||
| import json | import json | ||||||
| import unittest | import unittest | ||||||
| 
 | 
 | ||||||
| import frappe | import frappe | ||||||
| from six import string_types |  | ||||||
| 
 | 
 | ||||||
| from erpnext.controllers.item_variant import copy_attributes_to_variant, make_variant_item_code | from erpnext.controllers.item_variant import copy_attributes_to_variant, make_variant_item_code | ||||||
| from erpnext.stock.doctype.item.test_item import set_item_variant_settings | from erpnext.stock.doctype.item.test_item import set_item_variant_settings | ||||||
| @ -20,7 +18,7 @@ class TestItemVariant(unittest.TestCase): | |||||||
| 		self.assertEqual(variant.get("quality_inspection_template"), "_Test QC Template") | 		self.assertEqual(variant.get("quality_inspection_template"), "_Test QC Template") | ||||||
| 
 | 
 | ||||||
| def create_variant_with_tables(item, args): | def create_variant_with_tables(item, args): | ||||||
| 	if isinstance(args, string_types): | 	if isinstance(args, str): | ||||||
| 		args = json.loads(args) | 		args = json.loads(args) | ||||||
| 
 | 
 | ||||||
| 	qc_name = make_quality_inspection_template() | 	qc_name = make_quality_inspection_template() | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| import json | import json | ||||||
| import unittest | import unittest | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| import unittest | import unittest | ||||||
| from uuid import uuid4 as _uuid4 | from uuid import uuid4 as _uuid4 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -7,7 +7,6 @@ import json | |||||||
| import frappe | import frappe | ||||||
| from frappe.model.document import Document | from frappe.model.document import Document | ||||||
| from frappe.utils.jinja import validate_template | from frappe.utils.jinja import validate_template | ||||||
| from six import string_types |  | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| class ContractTemplate(Document): | class ContractTemplate(Document): | ||||||
| @ -17,7 +16,7 @@ class ContractTemplate(Document): | |||||||
| 
 | 
 | ||||||
| @frappe.whitelist() | @frappe.whitelist() | ||||||
| def get_contract_template(template_name, doc): | def get_contract_template(template_name, doc): | ||||||
| 	if isinstance(doc, string_types): | 	if isinstance(doc, str): | ||||||
| 		doc = json.loads(doc) | 		doc = json.loads(doc) | ||||||
| 
 | 
 | ||||||
| 	contract_template = frappe.get_doc("Contract Template", template_name) | 	contract_template = frappe.get_doc("Contract Template", template_name) | ||||||
|  | |||||||
| @ -1,5 +1,3 @@ | |||||||
| 
 |  | ||||||
| 
 |  | ||||||
| def get_data(): | def get_data(): | ||||||
| 	return { | 	return { | ||||||
| 		'fieldname': 'lead', | 		'fieldname': 'lead', | ||||||
|  | |||||||
| @ -1,5 +1,3 @@ | |||||||
| 
 |  | ||||||
| 
 |  | ||||||
| def get_data(): | def get_data(): | ||||||
| 	return { | 	return { | ||||||
| 		'fieldname': 'opportunity', | 		'fieldname': 'opportunity', | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| import frappe | import frappe | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -6,7 +6,6 @@ import frappe | |||||||
| import pandas | import pandas | ||||||
| from frappe import _ | from frappe import _ | ||||||
| from frappe.utils import flt | from frappe.utils import flt | ||||||
| from six import iteritems |  | ||||||
| 
 | 
 | ||||||
| from erpnext.setup.utils import get_exchange_rate | from erpnext.setup.utils import get_exchange_rate | ||||||
| 
 | 
 | ||||||
| @ -126,7 +125,7 @@ class OpportunitySummaryBySalesStage(object): | |||||||
| 		self.data = [] | 		self.data = [] | ||||||
| 		self.get_formatted_data() | 		self.get_formatted_data() | ||||||
| 
 | 
 | ||||||
| 		for based_on,data in iteritems(self.formatted_data): | 		for based_on,data in self.formatted_data.items(): | ||||||
| 			row_based_on={ | 			row_based_on={ | ||||||
| 				'Opportunity Owner': 'opportunity_owner', | 				'Opportunity Owner': 'opportunity_owner', | ||||||
| 				'Source': 'source', | 				'Source': 'source', | ||||||
|  | |||||||
| @ -9,7 +9,6 @@ import pandas | |||||||
| from dateutil.relativedelta import relativedelta | from dateutil.relativedelta import relativedelta | ||||||
| from frappe import _ | from frappe import _ | ||||||
| from frappe.utils import cint, flt | from frappe.utils import cint, flt | ||||||
| from six import iteritems |  | ||||||
| 
 | 
 | ||||||
| from erpnext.setup.utils import get_exchange_rate | from erpnext.setup.utils import get_exchange_rate | ||||||
| 
 | 
 | ||||||
| @ -295,7 +294,7 @@ class SalesPipelineAnalytics(object): | |||||||
| 
 | 
 | ||||||
| 	def append_data(self, pipeline_by, period_by): | 	def append_data(self, pipeline_by, period_by): | ||||||
| 		self.data = [] | 		self.data = [] | ||||||
| 		for pipeline,period_data in iteritems(self.periodic_data): | 		for pipeline,period_data in self.periodic_data.items(): | ||||||
| 			row = {pipeline_by : pipeline} | 			row = {pipeline_by : pipeline} | ||||||
| 			for info in self.query_result: | 			for info in self.query_result: | ||||||
| 				if self.filters.get('range') == 'Monthly': | 				if self.filters.get('range') == 'Monthly': | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| import sys | import sys | ||||||
| 
 | 
 | ||||||
| import frappe | import frappe | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| data = { | data = { | ||||||
| 	'Manufacturing': { | 	'Manufacturing': { | ||||||
| 		'company_name': 'Wind Power LLC' | 		'company_name': 'Wind Power LLC' | ||||||
|  | |||||||
| @ -1,10 +1,8 @@ | |||||||
| 
 |  | ||||||
| import json | import json | ||||||
| import random | import random | ||||||
| 
 | 
 | ||||||
| import frappe | import frappe | ||||||
| from frappe.utils import add_days, nowdate | from frappe.utils import add_days, nowdate | ||||||
| from six import iteritems |  | ||||||
| 
 | 
 | ||||||
| from erpnext.demo.domains import data | from erpnext.demo.domains import data | ||||||
| from erpnext.demo.setup.setup_data import import_json | from erpnext.demo.setup.setup_data import import_json | ||||||
| @ -130,7 +128,7 @@ def setup_item_price(): | |||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	for price_list in ("standard_buying", "standard_selling"): | 	for price_list in ("standard_buying", "standard_selling"): | ||||||
| 		for item, rate in iteritems(locals().get(price_list)): | 		for item, rate in locals().get(price_list).items(): | ||||||
| 			frappe.get_doc({ | 			frappe.get_doc({ | ||||||
| 				"doctype": "Item Price", | 				"doctype": "Item Price", | ||||||
| 				"price_list": price_list.replace("_", " ").title(), | 				"price_list": price_list.replace("_", " ").title(), | ||||||
|  | |||||||
| @ -1,8 +1,6 @@ | |||||||
| 
 |  | ||||||
| import json | import json | ||||||
| 
 | 
 | ||||||
| import frappe | import frappe | ||||||
| from six import iteritems |  | ||||||
| 
 | 
 | ||||||
| from erpnext.demo.domains import data | from erpnext.demo.domains import data | ||||||
| 
 | 
 | ||||||
| @ -52,7 +50,7 @@ def setup_item_price(): | |||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	for price_list in ("standard_buying", "standard_selling"): | 	for price_list in ("standard_buying", "standard_selling"): | ||||||
| 		for item, rate in iteritems(locals().get(price_list)): | 		for item, rate in locals().get(price_list).items(): | ||||||
| 			frappe.get_doc({ | 			frappe.get_doc({ | ||||||
| 				"doctype": "Item Price", | 				"doctype": "Item Price", | ||||||
| 				"price_list": price_list.replace("_", " ").title(), | 				"price_list": price_list.replace("_", " ").title(), | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| import json | import json | ||||||
| import random | import random | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | ||||||
| # License: GNU General Public License v3. See license.txt | # License: GNU General Public License v3. See license.txt | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | ||||||
| # License: GNU General Public License v3. See license.txt | # License: GNU General Public License v3. See license.txt | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | ||||||
| # License: GNU General Public License v3. See license.txt | # License: GNU General Public License v3. See license.txt | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| import datetime | import datetime | ||||||
| import random | import random | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| data = { | data = { | ||||||
| 	'desktop_icons': [ | 	'desktop_icons': [ | ||||||
| 		'Agriculture Task', | 		'Agriculture Task', | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| data = { | data = { | ||||||
| 	'desktop_icons': [ | 	'desktop_icons': [ | ||||||
| 		'Item', | 		'Item', | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| data = { | data = { | ||||||
| 	'desktop_icons': [ | 	'desktop_icons': [ | ||||||
| 		'Student', | 		'Student', | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| 
 |  | ||||||
| data = { | data = { | ||||||
| 	'desktop_icons': [ | 	'desktop_icons': [ | ||||||
| 		'Restaurant', | 		'Restaurant', | ||||||
|  | |||||||
Some files were not shown because too many files have changed in this diff Show More
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user