Merge branch 'master' of github.com:webnotes/erpnext
This commit is contained in:
commit
b94866c264
@ -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':
|
||||||
|
@ -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.",
|
||||||
|
@ -1,258 +1,211 @@
|
|||||||
# DocType, Item Group
|
|
||||||
[
|
[
|
||||||
|
{
|
||||||
# These values are common in all dictionaries
|
"owner": "Administrator",
|
||||||
{
|
"docstatus": 0,
|
||||||
'creation': '2012-07-03 13:30:53',
|
"creation": "2012-07-12 23:29:44",
|
||||||
'docstatus': 0,
|
"modified_by": "Administrator",
|
||||||
'modified': '2012-07-12 11:26:21',
|
"modified": "2012-12-03 18:05:25"
|
||||||
'modified_by': u'Administrator',
|
},
|
||||||
'owner': u'Administrator'
|
{
|
||||||
},
|
"in_create": 1,
|
||||||
|
"search_fields": "parent_item_group",
|
||||||
# These values are common for all DocType
|
"module": "Setup",
|
||||||
{
|
"autoname": "field:item_group_name",
|
||||||
'_last_update': u'1322549700',
|
"document_type": "Master",
|
||||||
'allow_trash': 1,
|
"description": "Item Classification",
|
||||||
'autoname': u'field:item_group_name',
|
"issingle": 0,
|
||||||
'colour': u'White:FFF',
|
"name": "__common__",
|
||||||
'default_print_format': u'Standard',
|
"default_print_format": "Standard",
|
||||||
'description': u'Item Classification',
|
"allow_rename": 1,
|
||||||
'doctype': 'DocType',
|
"doctype": "DocType"
|
||||||
'document_type': u'Master',
|
},
|
||||||
'in_create': 1,
|
{
|
||||||
'issingle': 0,
|
"name": "__common__",
|
||||||
'module': u'Setup',
|
"parent": "Item Group",
|
||||||
'name': '__common__',
|
"doctype": "DocField",
|
||||||
'search_fields': u'parent_item_group',
|
"parenttype": "DocType",
|
||||||
'section_style': u'Simple',
|
"parentfield": "fields"
|
||||||
'server_code_error': u' ',
|
},
|
||||||
'show_in_menu': 0,
|
{
|
||||||
'version': 1
|
"name": "__common__",
|
||||||
},
|
"parent": "Item Group",
|
||||||
|
"read": 1,
|
||||||
# These values are common for all DocField
|
"doctype": "DocPerm",
|
||||||
{
|
"parenttype": "DocType",
|
||||||
'doctype': u'DocField',
|
"parentfield": "permissions"
|
||||||
'name': '__common__',
|
},
|
||||||
'parent': u'Item Group',
|
{
|
||||||
'parentfield': u'fields',
|
"name": "Item Group",
|
||||||
'parenttype': u'DocType'
|
"doctype": "DocType"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
# These values are common for all DocPerm
|
"no_copy": 0,
|
||||||
{
|
"oldfieldtype": "Data",
|
||||||
'doctype': u'DocPerm',
|
"doctype": "DocField",
|
||||||
'name': '__common__',
|
"label": "Item Group Name",
|
||||||
'parent': u'Item Group',
|
"oldfieldname": "item_group_name",
|
||||||
'parentfield': u'permissions',
|
"fieldname": "item_group_name",
|
||||||
'parenttype': u'DocType',
|
"fieldtype": "Data",
|
||||||
'read': 1
|
"search_index": 0,
|
||||||
},
|
"reqd": 1,
|
||||||
|
"permlevel": 0
|
||||||
# DocType, Item Group
|
},
|
||||||
{
|
{
|
||||||
'doctype': 'DocType',
|
"description": "Check this if you want to show in website",
|
||||||
'name': u'Item Group'
|
"no_copy": 0,
|
||||||
},
|
"search_index": 0,
|
||||||
|
"colour": "White:FFF",
|
||||||
# DocPerm
|
"doctype": "DocField",
|
||||||
{
|
"label": "Show in Website",
|
||||||
'amend': 0,
|
"fieldname": "show_in_website",
|
||||||
'cancel': 0,
|
"fieldtype": "Check",
|
||||||
'create': 0,
|
"permlevel": 0
|
||||||
'doctype': u'DocPerm',
|
},
|
||||||
'permlevel': 1,
|
{
|
||||||
'role': u'Material Manager',
|
"doctype": "DocField",
|
||||||
'submit': 0,
|
"fieldname": "cb0",
|
||||||
'write': 0
|
"fieldtype": "Column Break",
|
||||||
},
|
"permlevel": 0
|
||||||
|
},
|
||||||
# DocPerm
|
{
|
||||||
{
|
"no_copy": 0,
|
||||||
'amend': 0,
|
"oldfieldtype": "Link",
|
||||||
'cancel': 0,
|
"doctype": "DocField",
|
||||||
'create': 0,
|
"label": "Parent Item Group",
|
||||||
'doctype': u'DocPerm',
|
"oldfieldname": "parent_item_group",
|
||||||
'permlevel': 0,
|
"permlevel": 0,
|
||||||
'role': u'Material Manager',
|
"trigger": "Client",
|
||||||
'submit': 0,
|
"fieldname": "parent_item_group",
|
||||||
'write': 0
|
"fieldtype": "Link",
|
||||||
},
|
"search_index": 0,
|
||||||
|
"reqd": 1,
|
||||||
# DocPerm
|
"options": "Item Group"
|
||||||
{
|
},
|
||||||
'amend': 0,
|
{
|
||||||
'cancel': 0,
|
"description": "Only leaf nodes are allowed in transaction",
|
||||||
'create': 0,
|
"no_copy": 0,
|
||||||
'doctype': u'DocPerm',
|
"oldfieldtype": "Select",
|
||||||
'permlevel': 1,
|
"colour": "White:FFF",
|
||||||
'role': u'Material User',
|
"doctype": "DocField",
|
||||||
'submit': 0,
|
"label": "Has Child Node",
|
||||||
'write': 0
|
"oldfieldname": "is_group",
|
||||||
},
|
"permlevel": 0,
|
||||||
|
"fieldname": "is_group",
|
||||||
# DocPerm
|
"fieldtype": "Select",
|
||||||
{
|
"search_index": 0,
|
||||||
'amend': 0,
|
"reqd": 1,
|
||||||
'cancel': 0,
|
"options": "\nYes\nNo"
|
||||||
'create': 0,
|
},
|
||||||
'doctype': u'DocPerm',
|
{
|
||||||
'permlevel': 0,
|
"no_copy": 0,
|
||||||
'role': u'Material User',
|
"oldfieldtype": "Small Text",
|
||||||
'submit': 0,
|
"doctype": "DocField",
|
||||||
'write': 0
|
"label": "Trash Reason",
|
||||||
},
|
"oldfieldname": "trash_reason",
|
||||||
|
"fieldname": "trash_reason",
|
||||||
# DocPerm
|
"fieldtype": "Small Text",
|
||||||
{
|
"search_index": 0,
|
||||||
'cancel': 1,
|
"permlevel": 1
|
||||||
'create': 1,
|
},
|
||||||
'doctype': u'DocPerm',
|
{
|
||||||
'permlevel': 0,
|
"print_hide": 1,
|
||||||
'role': u'System Manager',
|
"no_copy": 1,
|
||||||
'write': 1
|
"oldfieldtype": "Int",
|
||||||
},
|
"doctype": "DocField",
|
||||||
|
"label": "lft",
|
||||||
# DocPerm
|
"oldfieldname": "lft",
|
||||||
{
|
"fieldname": "lft",
|
||||||
'cancel': 1,
|
"fieldtype": "Int",
|
||||||
'create': 1,
|
"search_index": 1,
|
||||||
'doctype': u'DocPerm',
|
"hidden": 1,
|
||||||
'permlevel': 0,
|
"permlevel": 0,
|
||||||
'role': u'Material Master Manager',
|
"report_hide": 0,
|
||||||
'write': 1
|
"in_filter": 1
|
||||||
},
|
},
|
||||||
|
{
|
||||||
# DocField
|
"print_hide": 1,
|
||||||
{
|
"no_copy": 1,
|
||||||
'doctype': u'DocField',
|
"oldfieldtype": "Int",
|
||||||
'fieldname': u'item_group_name',
|
"doctype": "DocField",
|
||||||
'fieldtype': u'Data',
|
"label": "rgt",
|
||||||
'label': u'Item Group Name',
|
"oldfieldname": "rgt",
|
||||||
'no_copy': 0,
|
"fieldname": "rgt",
|
||||||
'oldfieldname': u'item_group_name',
|
"fieldtype": "Int",
|
||||||
'oldfieldtype': u'Data',
|
"search_index": 1,
|
||||||
'permlevel': 0,
|
"hidden": 1,
|
||||||
'reqd': 1,
|
"permlevel": 0,
|
||||||
'search_index': 0
|
"report_hide": 0,
|
||||||
},
|
"in_filter": 1
|
||||||
|
},
|
||||||
# DocField
|
{
|
||||||
{
|
"print_hide": 1,
|
||||||
'colour': u'White:FFF',
|
"no_copy": 1,
|
||||||
'description': u'Check this if you want to show in website',
|
"oldfieldtype": "Data",
|
||||||
'doctype': u'DocField',
|
"doctype": "DocField",
|
||||||
'fieldname': u'show_in_website',
|
"label": "old_parent",
|
||||||
'fieldtype': u'Check',
|
"oldfieldname": "old_parent",
|
||||||
'label': u'Show in Website',
|
"permlevel": 0,
|
||||||
'no_copy': 0,
|
"fieldname": "old_parent",
|
||||||
'permlevel': 0,
|
"fieldtype": "Link",
|
||||||
'search_index': 0
|
"search_index": 0,
|
||||||
},
|
"hidden": 1,
|
||||||
|
"options": "Item Group",
|
||||||
# DocField
|
"report_hide": 1
|
||||||
{
|
},
|
||||||
'doctype': u'DocField',
|
{
|
||||||
'fieldname': u'cb0',
|
"amend": 0,
|
||||||
'fieldtype': u'Column Break',
|
"create": 0,
|
||||||
'permlevel': 0
|
"doctype": "DocPerm",
|
||||||
},
|
"submit": 0,
|
||||||
|
"write": 0,
|
||||||
# DocField
|
"cancel": 0,
|
||||||
{
|
"role": "Material Manager",
|
||||||
'doctype': u'DocField',
|
"permlevel": 1
|
||||||
'fieldname': u'parent_item_group',
|
},
|
||||||
'fieldtype': u'Link',
|
{
|
||||||
'label': u'Parent Item Group',
|
"amend": 0,
|
||||||
'no_copy': 0,
|
"create": 0,
|
||||||
'oldfieldname': u'parent_item_group',
|
"doctype": "DocPerm",
|
||||||
'oldfieldtype': u'Link',
|
"submit": 0,
|
||||||
'options': u'Item Group',
|
"write": 0,
|
||||||
'permlevel': 0,
|
"cancel": 0,
|
||||||
'reqd': 1,
|
"role": "Material Manager",
|
||||||
'search_index': 0,
|
"permlevel": 0
|
||||||
'trigger': u'Client'
|
},
|
||||||
},
|
{
|
||||||
|
"amend": 0,
|
||||||
# DocField
|
"create": 0,
|
||||||
{
|
"doctype": "DocPerm",
|
||||||
'colour': u'White:FFF',
|
"submit": 0,
|
||||||
'description': u'Only leaf nodes are allowed in transaction',
|
"write": 0,
|
||||||
'doctype': u'DocField',
|
"cancel": 0,
|
||||||
'fieldname': u'is_group',
|
"role": "Material User",
|
||||||
'fieldtype': u'Select',
|
"permlevel": 1
|
||||||
'label': u'Has Child Node',
|
},
|
||||||
'no_copy': 0,
|
{
|
||||||
'oldfieldname': u'is_group',
|
"amend": 0,
|
||||||
'oldfieldtype': u'Select',
|
"create": 0,
|
||||||
'options': u'\nYes\nNo',
|
"doctype": "DocPerm",
|
||||||
'permlevel': 0,
|
"submit": 0,
|
||||||
'reqd': 1,
|
"write": 0,
|
||||||
'search_index': 0
|
"cancel": 0,
|
||||||
},
|
"role": "Material User",
|
||||||
|
"permlevel": 0
|
||||||
# DocField
|
},
|
||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
"create": 1,
|
||||||
'fieldname': u'trash_reason',
|
"doctype": "DocPerm",
|
||||||
'fieldtype': u'Small Text',
|
"write": 1,
|
||||||
'label': u'Trash Reason',
|
"role": "System Manager",
|
||||||
'no_copy': 0,
|
"cancel": 1,
|
||||||
'oldfieldname': u'trash_reason',
|
"permlevel": 0
|
||||||
'oldfieldtype': u'Small Text',
|
},
|
||||||
'permlevel': 1,
|
{
|
||||||
'search_index': 0
|
"create": 1,
|
||||||
},
|
"doctype": "DocPerm",
|
||||||
|
"write": 1,
|
||||||
# DocField
|
"role": "Material Master Manager",
|
||||||
{
|
"cancel": 1,
|
||||||
'doctype': u'DocField',
|
"permlevel": 0
|
||||||
'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
|
|
||||||
},
|
|
||||||
|
|
||||||
# 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
|
|
||||||
},
|
|
||||||
|
|
||||||
# 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
|
|
||||||
}
|
|
||||||
]
|
]
|
@ -230,7 +230,8 @@ 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
|
||||||
self.make_sl_entry(d, d.warehouse, flt(pr_qty), d.valuation_rate, is_submit)
|
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
|
# UPDATE actual to rejected warehouse by rejected qty
|
||||||
if flt(d.rejected_qty) > 0:
|
if flt(d.rejected_qty) > 0:
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user