[naming series] create, remove Property Setters to set naming fixes webnotes/erpnext#854

This commit is contained in:
Rushabh Mehta
2013-10-18 17:23:50 +05:30
parent 5566bcaa0e
commit 70d7c481e9
13 changed files with 67 additions and 34 deletions

View File

@@ -6,11 +6,7 @@ cur_frm.cscript.refresh = function(doc) {
// read only if any stock ledger entry exists
cur_frm.cscript.make_dashboard()
cur_frm.toggle_display("naming_series", sys_defaults.item_naming_by=="Naming Series"
&& doc.__islocal)
cur_frm.toggle_display("item_code", sys_defaults.item_naming_by!="Naming Series"
&& doc.__islocal)
erpnext.hide_naming_series();
if(!doc.__islocal && doc.show_in_website) {
cur_frm.add_custom_button("View In Website", function() {

View File

@@ -6,6 +6,7 @@
from __future__ import unicode_literals
import webnotes
class DocType:
def __init__(self, d, dl):
self.doc, self.doclist = d, dl
@@ -14,3 +15,8 @@ class DocType:
for key in ["item_naming_by", "item_group", "stock_uom",
"allow_negative_stock"]:
webnotes.conn.set_default(key, self.doc.fields.get(key, ""))
from setup.doctype.naming_series.naming_series import set_by_naming_series
set_by_naming_series("Item", "item_code",
self.doc.get("item_naming_by")=="Naming Series", hide_name_field=True)