initial prototype implementation for issue #856
This commit is contained in:
parent
256c4da0a5
commit
24b26db327
@ -5,18 +5,23 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import webnotes
|
import webnotes
|
||||||
|
from webnotes import _
|
||||||
|
|
||||||
class DocType:
|
class DocType:
|
||||||
def __init__(self, d, dl):
|
def __init__(self, d, dl):
|
||||||
self.doc, self.doclist = d, dl
|
self.doc, self.doclist = d, dl
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
for key in ["item_naming_by", "item_group", "stock_uom",
|
for key in ["item_naming_by", "item_group", "stock_uom",
|
||||||
"allow_negative_stock"]:
|
"allow_negative_stock"]:
|
||||||
webnotes.conn.set_default(key, self.doc.fields.get(key, ""))
|
webnotes.conn.set_default(key, self.doc.fields.get(key, ""))
|
||||||
|
|
||||||
from setup.doctype.naming_series.naming_series import set_by_naming_series
|
from setup.doctype.naming_series.naming_series import set_by_naming_series
|
||||||
set_by_naming_series("Item", "item_code",
|
set_by_naming_series("Item", "item_code",
|
||||||
self.doc.get("item_naming_by")=="Naming Series", hide_name_field=True)
|
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)
|
||||||
|
@ -1,128 +1,134 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"creation": "2013-06-24 16:37:54",
|
"creation": "2013-06-24 16:37:54",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"modified": "2013-11-02 19:41:56",
|
"modified": "2014-01-27 13:29:56",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"owner": "Administrator"
|
"owner": "Administrator"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"description": "Settings",
|
"description": "Settings",
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"icon": "icon-cog",
|
"icon": "icon-cog",
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "__common__"
|
"name": "__common__"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
"name": "__common__",
|
"name": "__common__",
|
||||||
"parent": "Stock Settings",
|
"parent": "Stock Settings",
|
||||||
"parentfield": "fields",
|
"parentfield": "fields",
|
||||||
"parenttype": "DocType",
|
"parenttype": "DocType",
|
||||||
"permlevel": 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"create": 1,
|
"create": 1,
|
||||||
"doctype": "DocPerm",
|
"doctype": "DocPerm",
|
||||||
"name": "__common__",
|
"name": "__common__",
|
||||||
"parent": "Stock Settings",
|
"parent": "Stock Settings",
|
||||||
"parentfield": "permissions",
|
"parentfield": "permissions",
|
||||||
"parenttype": "DocType",
|
"parenttype": "DocType",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"read": 1,
|
"read": 1,
|
||||||
"role": "Material Manager",
|
"role": "Material Manager",
|
||||||
"write": 1
|
"write": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"name": "Stock Settings"
|
"name": "Stock Settings"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
"fieldname": "item_naming_by",
|
"fieldname": "item_naming_by",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"label": "Item Naming By",
|
"label": "Item Naming By",
|
||||||
"options": "Item Code\nNaming Series"
|
"options": "Item Code\nNaming Series"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
|
"description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
"fieldname": "item_group",
|
"fieldname": "item_group",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Default Item Group",
|
"label": "Default Item Group",
|
||||||
"options": "Item Group"
|
"options": "Item Group"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
"fieldname": "stock_uom",
|
"fieldname": "stock_uom",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Default Stock UOM",
|
"label": "Default Stock UOM",
|
||||||
"options": "UOM"
|
"options": "UOM"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
"fieldname": "column_break_4",
|
"fieldname": "column_break_4",
|
||||||
"fieldtype": "Column Break"
|
"fieldtype": "Column Break"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
"fieldname": "allow_negative_stock",
|
"fieldname": "allow_negative_stock",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Allow Negative Stock"
|
"label": "Allow Negative Stock"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
"fieldname": "valuation_method",
|
"fieldname": "valuation_method",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"label": "Default Valuation Method",
|
"label": "Default Valuation Method",
|
||||||
"options": "FIFO\nMoving Average"
|
"options": "FIFO\nMoving Average"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"description": "Percentage you are allowed to receive or deliver more against the quantity ordered. For example: If you have ordered 100 units. and your Allowance is 10% then you are allowed to receive 110 units.",
|
"description": "Percentage you are allowed to receive or deliver more against the quantity ordered. For example: If you have ordered 100 units. and your Allowance is 10% then you are allowed to receive 110 units.",
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
"fieldname": "tolerance",
|
"fieldname": "tolerance",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"label": "Allowance Percent"
|
"label": "Allowance Percent"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
"fieldname": "auto_material_request",
|
"fieldname": "auto_material_request",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"label": "Auto Material Request"
|
"label": "Auto Material Request"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
"fieldname": "auto_indent",
|
"fieldname": "auto_indent",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Raise Material Request when stock reaches re-order level"
|
"label": "Raise Material Request when stock reaches re-order level"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
"fieldname": "reorder_email_notify",
|
"fieldname": "reorder_email_notify",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Notify by Email on creation of automatic Material Request"
|
"label": "Notify by Email on creation of automatic Material Request"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
"fieldname": "freeze_stock_entries",
|
"fieldname": "freeze_stock_entries",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"label": "Freeze Stock Entries"
|
"label": "Freeze Stock Entries"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
"fieldname": "stock_frozen_upto",
|
"fieldname": "stock_frozen_upto",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"label": "Stock Frozen Upto"
|
"label": "Stock Frozen Upto"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
"fieldname": "stock_auth_role",
|
"fieldname": "stock_frozen_upto",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Int",
|
||||||
"label": "Role Allowed to edit frozen stock",
|
"label": "Stock Frozen Upto"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"doctype": "DocField",
|
||||||
|
"fieldname": "stock_auth_role",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "Role Allowed to edit frozen stock",
|
||||||
"options": "Role"
|
"options": "Role"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"doctype": "DocPerm"
|
"doctype": "DocPerm"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user