mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 00:14:50 +00:00
[naming series] create, remove Property Setters to set naming fixes webnotes/erpnext#854
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user