mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-29 18:04:46 +00:00
Merge branch 'master' of github.com:webnotes/erpnext
This commit is contained in:
@@ -24,6 +24,7 @@ class DocType(DocTypeNestedSet):
|
|||||||
def on_update(self):
|
def on_update(self):
|
||||||
self.validate_name_with_customer()
|
self.validate_name_with_customer()
|
||||||
super(DocType, self).on_update()
|
super(DocType, self).on_update()
|
||||||
|
self.validate_one_root()
|
||||||
|
|
||||||
def validate_name_with_customer(self):
|
def validate_name_with_customer(self):
|
||||||
if webnotes.conn.exists("Customer", self.doc.name):
|
if webnotes.conn.exists("Customer", self.doc.name):
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
{
|
{
|
||||||
"creation": "2013-01-10 16:34:23",
|
"creation": "2013-01-10 16:34:23",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"modified": "2013-07-05 14:34:20",
|
"modified": "2013-08-05 18:12:57",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"owner": "Administrator"
|
"owner": "Administrator"
|
||||||
},
|
},
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
"oldfieldname": "parent_customer_group",
|
"oldfieldname": "parent_customer_group",
|
||||||
"oldfieldtype": "Link",
|
"oldfieldtype": "Link",
|
||||||
"options": "Customer Group",
|
"options": "Customer Group",
|
||||||
"reqd": 1
|
"reqd": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"description": "Only leaf nodes are allowed in transaction",
|
"description": "Only leaf nodes are allowed in transaction",
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ class DocType(DocTypeNestedSet):
|
|||||||
|
|
||||||
from website.helpers.product import invalidate_cache_for
|
from website.helpers.product import invalidate_cache_for
|
||||||
|
|
||||||
|
|
||||||
if self.doc.show_in_website:
|
if self.doc.show_in_website:
|
||||||
from webnotes.webutils import update_page_name
|
from webnotes.webutils import update_page_name
|
||||||
# webpage updates
|
# webpage updates
|
||||||
@@ -38,6 +37,8 @@ class DocType(DocTypeNestedSet):
|
|||||||
|
|
||||||
webnotes.conn.set(self.doc, "page_name", None)
|
webnotes.conn.set(self.doc, "page_name", None)
|
||||||
|
|
||||||
|
self.validate_one_root()
|
||||||
|
|
||||||
def validate_name_with_item(self):
|
def validate_name_with_item(self):
|
||||||
if webnotes.conn.exists("Item", self.doc.name):
|
if webnotes.conn.exists("Item", self.doc.name):
|
||||||
webnotes.msgprint("An item exists with same name (%s), please change the \
|
webnotes.msgprint("An item exists with same name (%s), please change the \
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
{
|
{
|
||||||
"creation": "2013-03-28 10:35:29",
|
"creation": "2013-03-28 10:35:29",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"modified": "2013-07-23 12:00:14",
|
"modified": "2013-08-05 17:21:14",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"owner": "Administrator"
|
"owner": "Administrator"
|
||||||
},
|
},
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
"oldfieldname": "parent_item_group",
|
"oldfieldname": "parent_item_group",
|
||||||
"oldfieldtype": "Link",
|
"oldfieldtype": "Link",
|
||||||
"options": "Item Group",
|
"options": "Item Group",
|
||||||
"reqd": 1,
|
"reqd": 0,
|
||||||
"search_index": 0
|
"search_index": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -21,6 +21,10 @@ class DocType(DocTypeNestedSet):
|
|||||||
webnotes.msgprint("Either target qty or target amount is mandatory.")
|
webnotes.msgprint("Either target qty or target amount is mandatory.")
|
||||||
raise Exception
|
raise Exception
|
||||||
|
|
||||||
|
def on_update(self):
|
||||||
|
super(DocType, self).on_update()
|
||||||
|
self.validate_one_root()
|
||||||
|
|
||||||
def get_email_id(self):
|
def get_email_id(self):
|
||||||
profile = webnotes.conn.get_value("Employee", self.doc.employee, "user_id")
|
profile = webnotes.conn.get_value("Employee", self.doc.employee, "user_id")
|
||||||
if not profile:
|
if not profile:
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
{
|
{
|
||||||
"creation": "2013-01-10 16:34:24",
|
"creation": "2013-01-10 16:34:24",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"modified": "2013-07-10 12:51:58",
|
"modified": "2013-08-05 18:11:22",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"owner": "Administrator"
|
"owner": "Administrator"
|
||||||
},
|
},
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
"oldfieldname": "parent_sales_person",
|
"oldfieldname": "parent_sales_person",
|
||||||
"oldfieldtype": "Link",
|
"oldfieldtype": "Link",
|
||||||
"options": "Sales Person",
|
"options": "Sales Person",
|
||||||
"reqd": 1
|
"reqd": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
|
|||||||
@@ -20,4 +20,7 @@ class DocType(DocTypeNestedSet):
|
|||||||
if not flt(d.target_qty) and not flt(d.target_amount):
|
if not flt(d.target_qty) and not flt(d.target_amount):
|
||||||
msgprint("Either target qty or target amount is mandatory.")
|
msgprint("Either target qty or target amount is mandatory.")
|
||||||
raise Exception
|
raise Exception
|
||||||
|
|
||||||
|
def on_update(self):
|
||||||
|
super(DocType, self).on_update()
|
||||||
|
self.validate_one_root()
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
{
|
{
|
||||||
"creation": "2013-01-10 16:34:24",
|
"creation": "2013-01-10 16:34:24",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"modified": "2013-07-05 14:58:15",
|
"modified": "2013-08-05 18:12:29",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"owner": "Administrator"
|
"owner": "Administrator"
|
||||||
},
|
},
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
"oldfieldname": "parent_territory",
|
"oldfieldname": "parent_territory",
|
||||||
"oldfieldtype": "Link",
|
"oldfieldtype": "Link",
|
||||||
"options": "Territory",
|
"options": "Territory",
|
||||||
"reqd": 1
|
"reqd": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"description": "Only leaf nodes are allowed in transaction",
|
"description": "Only leaf nodes are allowed in transaction",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
{
|
{
|
||||||
"creation": "2013-05-03 10:45:46",
|
"creation": "2013-05-03 10:45:46",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"modified": "2013-07-26 16:26:15",
|
"modified": "2013-08-05 18:23:47",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"owner": "Administrator"
|
"owner": "Administrator"
|
||||||
},
|
},
|
||||||
@@ -35,9 +35,7 @@
|
|||||||
"parentfield": "permissions",
|
"parentfield": "permissions",
|
||||||
"parenttype": "DocType",
|
"parenttype": "DocType",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"read": 1,
|
"read": 1
|
||||||
"report": 1,
|
|
||||||
"submit": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
@@ -593,17 +591,6 @@
|
|||||||
"options": "Cost Center",
|
"options": "Cost Center",
|
||||||
"read_only": 0
|
"read_only": 0
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"depends_on": "eval:doc.is_sales_item==\"Yes\"",
|
|
||||||
"doctype": "DocField",
|
|
||||||
"fieldname": "sales_rate",
|
|
||||||
"fieldtype": "Float",
|
|
||||||
"hidden": 1,
|
|
||||||
"label": "Sales Rate",
|
|
||||||
"oldfieldname": "sales_rate",
|
|
||||||
"oldfieldtype": "Currency",
|
|
||||||
"read_only": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"depends_on": "eval:doc.is_sales_item==\"Yes\"",
|
"depends_on": "eval:doc.is_sales_item==\"Yes\"",
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
@@ -883,7 +870,9 @@
|
|||||||
"cancel": 1,
|
"cancel": 1,
|
||||||
"create": 1,
|
"create": 1,
|
||||||
"doctype": "DocPerm",
|
"doctype": "DocPerm",
|
||||||
|
"report": 1,
|
||||||
"role": "Material Master Manager",
|
"role": "Material Master Manager",
|
||||||
|
"submit": 0,
|
||||||
"write": 1
|
"write": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -891,7 +880,9 @@
|
|||||||
"cancel": 0,
|
"cancel": 0,
|
||||||
"create": 0,
|
"create": 0,
|
||||||
"doctype": "DocPerm",
|
"doctype": "DocPerm",
|
||||||
|
"report": 1,
|
||||||
"role": "Material Manager",
|
"role": "Material Manager",
|
||||||
|
"submit": 0,
|
||||||
"write": 0
|
"write": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -899,7 +890,21 @@
|
|||||||
"cancel": 0,
|
"cancel": 0,
|
||||||
"create": 0,
|
"create": 0,
|
||||||
"doctype": "DocPerm",
|
"doctype": "DocPerm",
|
||||||
|
"report": 1,
|
||||||
"role": "Material User",
|
"role": "Material User",
|
||||||
|
"submit": 0,
|
||||||
"write": 0
|
"write": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"doctype": "DocPerm",
|
||||||
|
"role": "Sales User"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"doctype": "DocPerm",
|
||||||
|
"role": "Purchase User"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"doctype": "DocPerm",
|
||||||
|
"role": "Accounts User"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
Reference in New Issue
Block a user