batch redesigned

This commit is contained in:
Neil Trini Lasrado 2014-12-15 17:42:33 +05:30
parent b2a84c7cd9
commit 26320fc755
4 changed files with 42 additions and 24 deletions

View File

@ -5,7 +5,8 @@ cur_frm.fields_dict['item'].get_query = function(doc, cdt, cdn) {
return { return {
query: "erpnext.controllers.queries.item_query", query: "erpnext.controllers.queries.item_query",
filters:{ filters:{
'is_stock_item': 'Yes' 'is_stock_item': 'Yes',
'has_batch_no': 'Yes'
} }
} }
} }

View File

@ -1,7 +1,7 @@
{ {
"allow_import": 1, "allow_import": 1,
"autoname": "field:batch_id", "autoname": "field:batch_id",
"creation": "2013-03-05 14:50:38.000000", "creation": "2013-03-05 14:50:38",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"document_type": "Master", "document_type": "Master",
@ -28,23 +28,10 @@
"reqd": 1 "reqd": 1
}, },
{ {
"fieldname": "description", "fieldname": "column_break_3",
"fieldtype": "Small Text", "fieldtype": "Column Break",
"in_list_view": 1,
"label": "Description",
"oldfieldname": "description",
"oldfieldtype": "Small Text",
"permlevel": 0, "permlevel": 0,
"width": "300px" "precision": ""
},
{
"fieldname": "expiry_date",
"fieldtype": "Date",
"in_list_view": 1,
"label": "Expiry Date",
"oldfieldname": "expiry_date",
"oldfieldtype": "Date",
"permlevel": 0
}, },
{ {
"fieldname": "start_date", "fieldname": "start_date",
@ -61,12 +48,37 @@
"oldfieldname": "finished_date", "oldfieldname": "finished_date",
"oldfieldtype": "Date", "oldfieldtype": "Date",
"permlevel": 0 "permlevel": 0
},
{
"fieldname": "expiry_date",
"fieldtype": "Date",
"in_list_view": 1,
"label": "Expiry Date",
"oldfieldname": "expiry_date",
"oldfieldtype": "Date",
"permlevel": 0
},
{
"fieldname": "section_break_7",
"fieldtype": "Section Break",
"permlevel": 0,
"precision": ""
},
{
"fieldname": "description",
"fieldtype": "Small Text",
"in_list_view": 1,
"label": "Batch Description",
"oldfieldname": "description",
"oldfieldtype": "Small Text",
"permlevel": 0,
"width": "300px"
} }
], ],
"icon": "icon-archive", "icon": "icon-archive",
"idx": 1, "idx": 1,
"max_attachments": 5, "max_attachments": 5,
"modified": "2014-01-20 17:48:24.000000", "modified": "2014-12-15 17:37:01.781726",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Batch", "name": "Batch",

View File

@ -12,6 +12,5 @@ class Batch(Document):
self.item_has_batch_enabled() self.item_has_batch_enabled()
def item_has_batch_enabled(self): def item_has_batch_enabled(self):
has_batch_no = frappe.db.get_value("Item",self.item,"has_batch_no") if frappe.db.get_value("Item",self.item,"has_batch_no") =='No':
if has_batch_no =='No':
frappe.throw(_("The selected item cannot have Batch")) frappe.throw(_("The selected item cannot have Batch"))

View File

@ -0,0 +1,6 @@
[
{
"doctype": "Batch",
"name": "_Test Batch 1"
}
]