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

This commit is contained in:
Rushabh Mehta 2012-12-03 13:46:14 +01:00
commit b94866c264
5 changed files with 217 additions and 264 deletions

View File

@ -353,10 +353,9 @@ class DocType(TransactionBase):
raise Exception
# validate stock item
if item[0][0]=='Yes':
if not d.warehouse:
msgprint("Warehouse is mandatory for %s, since it is a stock item" % d.item_code)
raise Exception
if item[0][0]=='Yes' and d.qty and not d.warehouse:
msgprint("Warehouse is mandatory for %s, since it is a stock item" %
d.item_code, raise_exception=1)
# validate purchase item
if item[0][1] != 'Yes' and item[0][2] != 'Yes':

View File

@ -1,7 +1,8 @@
erpnext.updates = [
["3rd December 2012", [
"Linked With: Added new Linked with in all Forms.",
"Rename Tool: Documents that can be renamed will have a 'Rename' option in the sidebar (wherever applicable).",
"Chart of Accounts: Ability to rename / delete from Chart of Accouns.",
"Chart of Accounts: Ability to rename / delete from Chart of Accounts.",
]],
["30th November 2012", [
"Auto Notifications: System will prompt user with pre-set message for auto-notification.",

View File

@ -1,258 +1,211 @@
# DocType, Item Group
[
# These values are common in all dictionaries
{
'creation': '2012-07-03 13:30:53',
'docstatus': 0,
'modified': '2012-07-12 11:26:21',
'modified_by': u'Administrator',
'owner': u'Administrator'
"owner": "Administrator",
"docstatus": 0,
"creation": "2012-07-12 23:29:44",
"modified_by": "Administrator",
"modified": "2012-12-03 18:05:25"
},
# These values are common for all DocType
{
'_last_update': u'1322549700',
'allow_trash': 1,
'autoname': u'field:item_group_name',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'description': u'Item Classification',
'doctype': 'DocType',
'document_type': u'Master',
'in_create': 1,
'issingle': 0,
'module': u'Setup',
'name': '__common__',
'search_fields': u'parent_item_group',
'section_style': u'Simple',
'server_code_error': u' ',
'show_in_menu': 0,
'version': 1
"in_create": 1,
"search_fields": "parent_item_group",
"module": "Setup",
"autoname": "field:item_group_name",
"document_type": "Master",
"description": "Item Classification",
"issingle": 0,
"name": "__common__",
"default_print_format": "Standard",
"allow_rename": 1,
"doctype": "DocType"
},
# These values are common for all DocField
{
'doctype': u'DocField',
'name': '__common__',
'parent': u'Item Group',
'parentfield': u'fields',
'parenttype': u'DocType'
"name": "__common__",
"parent": "Item Group",
"doctype": "DocField",
"parenttype": "DocType",
"parentfield": "fields"
},
# These values are common for all DocPerm
{
'doctype': u'DocPerm',
'name': '__common__',
'parent': u'Item Group',
'parentfield': u'permissions',
'parenttype': u'DocType',
'read': 1
"name": "__common__",
"parent": "Item Group",
"read": 1,
"doctype": "DocPerm",
"parenttype": "DocType",
"parentfield": "permissions"
},
# DocType, Item Group
{
'doctype': 'DocType',
'name': u'Item Group'
"name": "Item Group",
"doctype": "DocType"
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Material Manager',
'submit': 0,
'write': 0
"no_copy": 0,
"oldfieldtype": "Data",
"doctype": "DocField",
"label": "Item Group Name",
"oldfieldname": "item_group_name",
"fieldname": "item_group_name",
"fieldtype": "Data",
"search_index": 0,
"reqd": 1,
"permlevel": 0
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Material Manager',
'submit': 0,
'write': 0
"description": "Check this if you want to show in website",
"no_copy": 0,
"search_index": 0,
"colour": "White:FFF",
"doctype": "DocField",
"label": "Show in Website",
"fieldname": "show_in_website",
"fieldtype": "Check",
"permlevel": 0
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Material User',
'submit': 0,
'write': 0
"doctype": "DocField",
"fieldname": "cb0",
"fieldtype": "Column Break",
"permlevel": 0
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Material User',
'submit': 0,
'write': 0
"no_copy": 0,
"oldfieldtype": "Link",
"doctype": "DocField",
"label": "Parent Item Group",
"oldfieldname": "parent_item_group",
"permlevel": 0,
"trigger": "Client",
"fieldname": "parent_item_group",
"fieldtype": "Link",
"search_index": 0,
"reqd": 1,
"options": "Item Group"
},
# DocPerm
{
'cancel': 1,
'create': 1,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'System Manager',
'write': 1
"description": "Only leaf nodes are allowed in transaction",
"no_copy": 0,
"oldfieldtype": "Select",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Has Child Node",
"oldfieldname": "is_group",
"permlevel": 0,
"fieldname": "is_group",
"fieldtype": "Select",
"search_index": 0,
"reqd": 1,
"options": "\nYes\nNo"
},
# DocPerm
{
'cancel': 1,
'create': 1,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Material Master Manager',
'write': 1
"no_copy": 0,
"oldfieldtype": "Small Text",
"doctype": "DocField",
"label": "Trash Reason",
"oldfieldname": "trash_reason",
"fieldname": "trash_reason",
"fieldtype": "Small Text",
"search_index": 0,
"permlevel": 1
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'item_group_name',
'fieldtype': u'Data',
'label': u'Item Group Name',
'no_copy': 0,
'oldfieldname': u'item_group_name',
'oldfieldtype': u'Data',
'permlevel': 0,
'reqd': 1,
'search_index': 0
"print_hide": 1,
"no_copy": 1,
"oldfieldtype": "Int",
"doctype": "DocField",
"label": "lft",
"oldfieldname": "lft",
"fieldname": "lft",
"fieldtype": "Int",
"search_index": 1,
"hidden": 1,
"permlevel": 0,
"report_hide": 0,
"in_filter": 1
},
# DocField
{
'colour': u'White:FFF',
'description': u'Check this if you want to show in website',
'doctype': u'DocField',
'fieldname': u'show_in_website',
'fieldtype': u'Check',
'label': u'Show in Website',
'no_copy': 0,
'permlevel': 0,
'search_index': 0
"print_hide": 1,
"no_copy": 1,
"oldfieldtype": "Int",
"doctype": "DocField",
"label": "rgt",
"oldfieldname": "rgt",
"fieldname": "rgt",
"fieldtype": "Int",
"search_index": 1,
"hidden": 1,
"permlevel": 0,
"report_hide": 0,
"in_filter": 1
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'cb0',
'fieldtype': u'Column Break',
'permlevel': 0
"print_hide": 1,
"no_copy": 1,
"oldfieldtype": "Data",
"doctype": "DocField",
"label": "old_parent",
"oldfieldname": "old_parent",
"permlevel": 0,
"fieldname": "old_parent",
"fieldtype": "Link",
"search_index": 0,
"hidden": 1,
"options": "Item Group",
"report_hide": 1
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'parent_item_group',
'fieldtype': u'Link',
'label': u'Parent Item Group',
'no_copy': 0,
'oldfieldname': u'parent_item_group',
'oldfieldtype': u'Link',
'options': u'Item Group',
'permlevel': 0,
'reqd': 1,
'search_index': 0,
'trigger': u'Client'
"amend": 0,
"create": 0,
"doctype": "DocPerm",
"submit": 0,
"write": 0,
"cancel": 0,
"role": "Material Manager",
"permlevel": 1
},
# DocField
{
'colour': u'White:FFF',
'description': u'Only leaf nodes are allowed in transaction',
'doctype': u'DocField',
'fieldname': u'is_group',
'fieldtype': u'Select',
'label': u'Has Child Node',
'no_copy': 0,
'oldfieldname': u'is_group',
'oldfieldtype': u'Select',
'options': u'\nYes\nNo',
'permlevel': 0,
'reqd': 1,
'search_index': 0
"amend": 0,
"create": 0,
"doctype": "DocPerm",
"submit": 0,
"write": 0,
"cancel": 0,
"role": "Material Manager",
"permlevel": 0
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'trash_reason',
'fieldtype': u'Small Text',
'label': u'Trash Reason',
'no_copy': 0,
'oldfieldname': u'trash_reason',
'oldfieldtype': u'Small Text',
'permlevel': 1,
'search_index': 0
"amend": 0,
"create": 0,
"doctype": "DocPerm",
"submit": 0,
"write": 0,
"cancel": 0,
"role": "Material User",
"permlevel": 1
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'lft',
'fieldtype': u'Int',
'hidden': 1,
'in_filter': 1,
'label': u'lft',
'no_copy': 1,
'oldfieldname': u'lft',
'oldfieldtype': u'Int',
'permlevel': 0,
'print_hide': 1,
'report_hide': 0,
'search_index': 1
"amend": 0,
"create": 0,
"doctype": "DocPerm",
"submit": 0,
"write": 0,
"cancel": 0,
"role": "Material User",
"permlevel": 0
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'rgt',
'fieldtype': u'Int',
'hidden': 1,
'in_filter': 1,
'label': u'rgt',
'no_copy': 1,
'oldfieldname': u'rgt',
'oldfieldtype': u'Int',
'permlevel': 0,
'print_hide': 1,
'report_hide': 0,
'search_index': 1
"create": 1,
"doctype": "DocPerm",
"write": 1,
"role": "System Manager",
"cancel": 1,
"permlevel": 0
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'old_parent',
'fieldtype': u'Link',
'hidden': 1,
'label': u'old_parent',
'no_copy': 1,
'oldfieldname': u'old_parent',
'oldfieldtype': u'Data',
'options': u'Item Group',
'permlevel': 0,
'print_hide': 1,
'report_hide': 1,
'search_index': 0
"create": 1,
"doctype": "DocPerm",
"write": 1,
"role": "Material Master Manager",
"cancel": 1,
"permlevel": 0
}
]

View File

@ -230,6 +230,7 @@ class DocType(TransactionBase):
get_obj("Warehouse", d.warehouse).update_bin(args)
# UPDATE actual qty to warehouse by pr_qty
if pr_qty:
self.make_sl_entry(d, d.warehouse, flt(pr_qty), d.valuation_rate, is_submit)
# UPDATE actual to rejected warehouse by rejected qty

View File

@ -80,14 +80,13 @@ class DocType:
# [bug fix] need to strip serial nos of all spaces and new lines for validation
serial_no = cstr(d.serial_no).strip()
if serial_no:
if is_stock_item != 'Yes':
msgprint("Serial No is not required for non-stock item: %s" % d.item_code, raise_exception=1)
elif ar_required != 'Yes':
msgprint("If serial no required, please select 'Yes' in 'Has Serial No' in Item :" + d.item_code + \
', otherwise please remove serial no', raise_exception=1)
elif ar_required == 'Yes' and not serial_no:
elif ar_required == 'Yes' and not serial_no and d.qty:
msgprint("Serial no is mandatory for item: "+ d.item_code, raise_exception = 1)
# validate rejected serial nos