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

# For license information, please see license.txt

from __future__ import unicode_literals
import webnotes
from webnotes import _

class DocType:
	def __init__(self, d, dl):
		self.doc, self.doclist = d, dl

	def validate(self):
		for key in ["item_naming_by", "item_group", "stock_uom",
			"allow_negative_stock"]:
			webnotes.conn.set_default(key, self.doc.fields.get(key, ""))

		from setup.doctype.naming_series.naming_series import set_by_naming_series
		set_by_naming_series("Item", "item_code",
			self.doc.get("item_naming_by")=="Naming Series", hide_name_field=True)

		stock_frozen_limit = 356
		submitted_stock_frozen = self.doc.stock_frozen_upto_days
		if submitted_stock_frozen > stock_frozen_limit:
			self.doc.stock_frozen_upto_days = stock_frozen_limit
			webnotes.msgprint (_("`Stocks Freeze Older Than` should be smaller than %d days.") %stock_frozen_limit)<commit_msg>label/message update in error reporting<commit_after># Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt

# For license information, please see license.txt

from __future__ import unicode_literals
import webnotes
from webnotes import _

class DocType:
	def __init__(self, d, dl):
		self.doc, self.doclist = d, dl

	def validate(self):
		for key in ["item_naming_by", "item_group", "stock_uom",
			"allow_negative_stock"]:
			webnotes.conn.set_default(key, self.doc.fields.get(key, ""))

		from setup.doctype.naming_series.naming_series import set_by_naming_series
		set_by_naming_series("Item", "item_code",
			self.doc.get("item_naming_by")=="Naming Series", hide_name_field=True)

		stock_frozen_limit = 356
		submitted_stock_frozen = self.doc.stock_frozen_upto_days
		if submitted_stock_frozen > stock_frozen_limit:
			self.doc.stock_frozen_upto_days = stock_frozen_limit
			webnotes.msgprint (_("`Freeze Stocks Older Than` should be smaller than %d days.") %stock_frozen_limit)
{'fraction_non_alphanumeric': 0.09703632887189292, 'fraction_numerical': 0.0076481835564053535, 'mean_word_length': 5.708333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5030928', 'n_tokens_mistral': 787, 'n_tokens_neox': 707, 'n_words': 173}