mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-04 00:50:18 +00:00
Merge branch 'develop' into currency-exchange-settings
This commit is contained in:
@@ -413,7 +413,7 @@ def install_country_fixtures(company, country):
|
||||
frappe.get_attr(module_name)(company, False)
|
||||
except Exception as e:
|
||||
frappe.log_error()
|
||||
frappe.throw(_("Failed to setup defaults for country {0}. Please contact support@erpnext.com").format(frappe.bold(country)))
|
||||
frappe.throw(_("Failed to setup defaults for country {0}. Please contact support.").format(frappe.bold(country)))
|
||||
|
||||
|
||||
def update_company_current_month_sales(company):
|
||||
|
||||
@@ -43,7 +43,6 @@ class ItemGroup(NestedSet, WebsiteGenerator):
|
||||
def on_update(self):
|
||||
NestedSet.on_update(self)
|
||||
invalidate_cache_for(self)
|
||||
self.validate_name_with_item()
|
||||
self.validate_one_root()
|
||||
self.delete_child_item_groups_key()
|
||||
|
||||
@@ -67,10 +66,6 @@ class ItemGroup(NestedSet, WebsiteGenerator):
|
||||
WebsiteGenerator.on_trash(self)
|
||||
self.delete_child_item_groups_key()
|
||||
|
||||
def validate_name_with_item(self):
|
||||
if frappe.db.exists("Item", self.name):
|
||||
frappe.throw(frappe._("An item exists with same name ({0}), please change the item group name or rename the item").format(self.name), frappe.NameError)
|
||||
|
||||
def get_context(self, context):
|
||||
context.show_search=True
|
||||
context.page_length = cint(frappe.db.get_single_value('Products Settings', 'products_per_page')) or 6
|
||||
|
||||
@@ -180,11 +180,11 @@ class NamingSeries(Document):
|
||||
prefix = parse_naming_series(parts)
|
||||
return prefix
|
||||
|
||||
def set_by_naming_series(doctype, fieldname, naming_series, hide_name_field=True):
|
||||
def set_by_naming_series(doctype, fieldname, naming_series, hide_name_field=True, make_mandatory=1):
|
||||
from frappe.custom.doctype.property_setter.property_setter import make_property_setter
|
||||
if naming_series:
|
||||
make_property_setter(doctype, "naming_series", "hidden", 0, "Check", validate_fields_for_doctype=False)
|
||||
make_property_setter(doctype, "naming_series", "reqd", 1, "Check", validate_fields_for_doctype=False)
|
||||
make_property_setter(doctype, "naming_series", "reqd", make_mandatory, "Check", validate_fields_for_doctype=False)
|
||||
|
||||
# set values for mandatory
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user