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 raise Exception
# validate stock item # validate stock item
if item[0][0]=='Yes': if item[0][0]=='Yes' and d.qty and not d.warehouse:
if not d.warehouse: msgprint("Warehouse is mandatory for %s, since it is a stock item" %
msgprint("Warehouse is mandatory for %s, since it is a stock item" % d.item_code) d.item_code, raise_exception=1)
raise Exception
# validate purchase item # validate purchase item
if item[0][1] != 'Yes' and item[0][2] != 'Yes': if item[0][1] != 'Yes' and item[0][2] != 'Yes':

View File

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

View File

@ -230,6 +230,7 @@ class DocType(TransactionBase):
get_obj("Warehouse", d.warehouse).update_bin(args) get_obj("Warehouse", d.warehouse).update_bin(args)
# UPDATE actual qty to warehouse by pr_qty # 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) self.make_sl_entry(d, d.warehouse, flt(pr_qty), d.valuation_rate, is_submit)
# UPDATE actual to rejected warehouse by rejected qty # 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 # [bug fix] need to strip serial nos of all spaces and new lines for validation
serial_no = cstr(d.serial_no).strip() serial_no = cstr(d.serial_no).strip()
if serial_no: if serial_no:
if is_stock_item != 'Yes': if is_stock_item != 'Yes':
msgprint("Serial No is not required for non-stock item: %s" % d.item_code, raise_exception=1) msgprint("Serial No is not required for non-stock item: %s" % d.item_code, raise_exception=1)
elif ar_required != 'Yes': elif ar_required != 'Yes':
msgprint("If serial no required, please select 'Yes' in 'Has Serial No' in Item :" + d.item_code + \ 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) ', 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) msgprint("Serial no is mandatory for item: "+ d.item_code, raise_exception = 1)
# validate rejected serial nos # validate rejected serial nos