initial prototype implementation for issue #856

This commit is contained in:
Thura Hlaing 2014-01-27 14:08:55 +06:30
parent 256c4da0a5
commit 24b26db327
2 changed files with 105 additions and 94 deletions

View File

@ -5,7 +5,7 @@
from __future__ import unicode_literals
import webnotes
from webnotes import _
class DocType:
def __init__(self, d, dl):
@ -20,3 +20,8 @@ class DocType:
set_by_naming_series("Item", "item_code",
self.doc.get("item_naming_by")=="Naming Series", hide_name_field=True)
stock_frozen_limit = 356
submitted_stock_frozen = self.doc.fields.get("stock_frozen_upto")
if submitted_stock_frozen > stock_frozen_limit:
self.doc.fields["stock_frozen_upto"] = stock_frozen_limit
webnotes.msgprint (_("Stocks cannot be freezed for days larger than %d.") %stock_frozen_limit)

View File

@ -2,7 +2,7 @@
{
"creation": "2013-06-24 16:37:54",
"docstatus": 0,
"modified": "2013-11-02 19:41:56",
"modified": "2014-01-27 13:29:56",
"modified_by": "Administrator",
"owner": "Administrator"
},
@ -115,6 +115,12 @@
"fieldtype": "Date",
"label": "Stock Frozen Upto"
},
{
"doctype": "DocField",
"fieldname": "stock_frozen_upto",
"fieldtype": "Int",
"label": "Stock Frozen Upto"
},
{
"doctype": "DocField",
"fieldname": "stock_auth_role",