Merge branch 'master' of github.com:webnotes/erpnext

This commit is contained in:
Anand Doshi 2013-08-05 18:43:27 +05:30
commit 801ea1d5a0
9 changed files with 39 additions and 25 deletions

View File

@ -24,6 +24,7 @@ class DocType(DocTypeNestedSet):
def on_update(self):
self.validate_name_with_customer()
super(DocType, self).on_update()
self.validate_one_root()
def validate_name_with_customer(self):
if webnotes.conn.exists("Customer", self.doc.name):

View File

@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:23",
"docstatus": 0,
"modified": "2013-07-05 14:34:20",
"modified": "2013-08-05 18:12:57",
"modified_by": "Administrator",
"owner": "Administrator"
},
@ -69,7 +69,7 @@
"oldfieldname": "parent_customer_group",
"oldfieldtype": "Link",
"options": "Customer Group",
"reqd": 1
"reqd": 0
},
{
"description": "Only leaf nodes are allowed in transaction",

View File

@ -20,7 +20,6 @@ class DocType(DocTypeNestedSet):
from website.helpers.product import invalidate_cache_for
if self.doc.show_in_website:
from webnotes.webutils import update_page_name
# webpage updates
@ -38,6 +37,8 @@ class DocType(DocTypeNestedSet):
webnotes.conn.set(self.doc, "page_name", None)
self.validate_one_root()
def validate_name_with_item(self):
if webnotes.conn.exists("Item", self.doc.name):
webnotes.msgprint("An item exists with same name (%s), please change the \

View File

@ -2,7 +2,7 @@
{
"creation": "2013-03-28 10:35:29",
"docstatus": 0,
"modified": "2013-07-23 12:00:14",
"modified": "2013-08-05 17:21:14",
"modified_by": "Administrator",
"owner": "Administrator"
},
@ -75,7 +75,7 @@
"oldfieldname": "parent_item_group",
"oldfieldtype": "Link",
"options": "Item Group",
"reqd": 1,
"reqd": 0,
"search_index": 0
},
{

View File

@ -21,6 +21,10 @@ class DocType(DocTypeNestedSet):
webnotes.msgprint("Either target qty or target amount is mandatory.")
raise Exception
def on_update(self):
super(DocType, self).on_update()
self.validate_one_root()
def get_email_id(self):
profile = webnotes.conn.get_value("Employee", self.doc.employee, "user_id")
if not profile:

View File

@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:24",
"docstatus": 0,
"modified": "2013-07-10 12:51:58",
"modified": "2013-08-05 18:11:22",
"modified_by": "Administrator",
"owner": "Administrator"
},
@ -69,7 +69,7 @@
"oldfieldname": "parent_sales_person",
"oldfieldtype": "Link",
"options": "Sales Person",
"reqd": 1
"reqd": 0
},
{
"doctype": "DocField",

View File

@ -20,4 +20,7 @@ class DocType(DocTypeNestedSet):
if not flt(d.target_qty) and not flt(d.target_amount):
msgprint("Either target qty or target amount is mandatory.")
raise Exception
def on_update(self):
super(DocType, self).on_update()
self.validate_one_root()

View File

@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:24",
"docstatus": 0,
"modified": "2013-07-05 14:58:15",
"modified": "2013-08-05 18:12:29",
"modified_by": "Administrator",
"owner": "Administrator"
},
@ -71,7 +71,7 @@
"oldfieldname": "parent_territory",
"oldfieldtype": "Link",
"options": "Territory",
"reqd": 1
"reqd": 0
},
{
"description": "Only leaf nodes are allowed in transaction",

View File

@ -2,7 +2,7 @@
{
"creation": "2013-05-03 10:45:46",
"docstatus": 0,
"modified": "2013-07-26 16:26:15",
"modified": "2013-08-05 18:23:47",
"modified_by": "Administrator",
"owner": "Administrator"
},
@ -35,9 +35,7 @@
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
"read": 1,
"report": 1,
"submit": 0
"read": 1
},
{
"doctype": "DocType",
@ -593,17 +591,6 @@
"options": "Cost Center",
"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\"",
"doctype": "DocField",
@ -883,7 +870,9 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
"report": 1,
"role": "Material Master Manager",
"submit": 0,
"write": 1
},
{
@ -891,7 +880,9 @@
"cancel": 0,
"create": 0,
"doctype": "DocPerm",
"report": 1,
"role": "Material Manager",
"submit": 0,
"write": 0
},
{
@ -899,7 +890,21 @@
"cancel": 0,
"create": 0,
"doctype": "DocPerm",
"report": 1,
"role": "Material User",
"submit": 0,
"write": 0
},
{
"doctype": "DocPerm",
"role": "Sales User"
},
{
"doctype": "DocPerm",
"role": "Purchase User"
},
{
"doctype": "DocPerm",
"role": "Accounts User"
}
]