Merge branch 'edge' of github.com:webnotes/erpnext into webshop

Conflicts:
	stock/doctype/item/item.txt
This commit is contained in:
Anand Doshi
2013-05-10 18:12:24 +05:30
65 changed files with 529 additions and 184 deletions

View File

@@ -134,11 +134,7 @@ cur_frm.fields_dict.item_supplier_details.grid.get_field("supplier").get_query =
erpnext.utils.supplier_query;
cur_frm.cscript.on_remove_attachment = function(doc) {
// refresh image list before unsetting image
refresh_field("image");
if(!inList(cur_frm.fields_dict.image.df.options.split("\n"), doc.image)) {
// if the selected image is removed from attachment, unset it
cur_frm.set_value("image", "");
msgprint(wn._("Attachment removed. You may need to update: ")
+ wn.meta.get_docfield(doc.doctype, "description_html").label);
}
@@ -157,3 +153,7 @@ cur_frm.cscript.copy_from_item_group = function(doc) {
cur_frm.refresh();
});
}
cur_frm.cscript.image = function() {
refresh_field("image_view");
}

View File

@@ -31,7 +31,9 @@ class DocType(DocListController):
if webnotes.conn.get_default("item_naming_by")=="Naming Series":
from webnotes.model.doc import make_autoname
self.doc.item_code = make_autoname(self.doc.naming_series+'.#####')
elif not self.doc.item_code:
msgprint(_("Item Code is mandatory"), raise_exception=1)
self.doc.name = self.doc.item_code
def validate(self):
@@ -270,7 +272,7 @@ class DocType(DocListController):
from webnotes.webutils import clear_cache
clear_cache(self.doc.page_name)
def on_rename(self,newdn,olddn):
def on_rename(self,newdn,olddn, merge=False):
webnotes.conn.sql("update tabItem set item_code = %s where name = %s", (newdn, olddn))
if self.doc.page_name:
from webnotes.webutils import clear_cache

View File

@@ -1,8 +1,8 @@
[
{
"creation": "2013-04-25 10:56:55",
"creation": "2013-05-03 10:45:46",
"docstatus": 0,
"modified": "2013-05-02 15:10:00",
"modified": "2013-05-07 16:00:00",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -28,13 +28,14 @@
"permlevel": 0
},
{
"amend": 0,
"doctype": "DocPerm",
"name": "__common__",
"parent": "Item",
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
"read": 1,
"report": 1,
"submit": 0
},
{
@@ -55,7 +56,8 @@
"fieldname": "naming_series",
"fieldtype": "Select",
"label": "Naming Series",
"options": "\nITEM"
"options": "\nITEM",
"read_only": 0
},
{
"description": "Item will be saved by this name in the data base.",
@@ -64,10 +66,11 @@
"fieldtype": "Data",
"in_filter": 0,
"label": "Item Code",
"no_copy": 1,
"oldfieldname": "item_code",
"oldfieldtype": "Data",
"read_only": 0,
"reqd": 1,
"reqd": 0,
"search_index": 0
},
{
@@ -887,27 +890,23 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
"permlevel": 0,
"report": 1,
"role": "Material Manager",
"write": 1
},
{
"cancel": 0,
"create": 1,
"doctype": "DocPerm",
"permlevel": 0,
"report": 1,
"role": "Material User",
"write": 1
},
{
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
"permlevel": 0,
"report": 1,
"role": "Material Master Manager",
"write": 1
},
{
"amend": 0,
"cancel": 0,
"create": 0,
"doctype": "DocPerm",
"role": "Material Manager",
"write": 0
},
{
"amend": 0,
"cancel": 0,
"create": 0,
"doctype": "DocPerm",
"role": "Material User",
"write": 0
}
]