mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 16:34:46 +00:00
[fix] [cleanup] fixes while testing and code cleanup
This commit is contained in:
@@ -172,7 +172,7 @@ cur_frm.fields_dict['item'].get_query = function(doc) {
|
||||
return{
|
||||
query:"controllers.queries.item_query",
|
||||
filters:{
|
||||
'has_serial_no': 'Yes'
|
||||
'is_manufactured_item': 'Yes'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
from webnotes.utils import cstr, flt, now, nowdate
|
||||
from webnotes.utils import cstr, flt, nowdate
|
||||
from webnotes.model.code import get_obj
|
||||
from webnotes import msgprint
|
||||
|
||||
@@ -65,6 +65,7 @@ class DocType:
|
||||
where production_item = %s and sales_order = %s and docstatus < 2""",
|
||||
(self.doc.production_item, self.doc.sales_order))[0][0]
|
||||
|
||||
total_qty = flt(ordered_qty_against_so) + flt(self.doc.qty)
|
||||
|
||||
# get qty from Sales Order Item table
|
||||
so_item_qty = webnotes.conn.sql("""select sum(qty) from `tabSales Order Item`
|
||||
@@ -77,12 +78,12 @@ class DocType:
|
||||
# total qty in SO
|
||||
so_qty = flt(so_item_qty) + flt(dnpi_qty)
|
||||
|
||||
if ordered_qty_against_so > so_qty:
|
||||
if total_qty > so_qty:
|
||||
webnotes.msgprint("""Total production order qty for item: %s against sales order: %s \
|
||||
will be %s, which is greater than sales order qty (%s).
|
||||
Please reduce qty or remove the item.""" %
|
||||
(self.doc.production_item, self.doc.sales_order,
|
||||
ordered_qty_against_so, so_qty), raise_exception=1)
|
||||
total_qty, so_qty), raise_exception=1)
|
||||
|
||||
|
||||
def stop_unstop(self, status):
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
"creation": "2013-01-10 16:34:16",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-07-05 14:51:12",
|
||||
"modified": "2013-07-11 15:51:37",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
@@ -35,7 +35,6 @@
|
||||
"permlevel": 0,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Manufacturing User",
|
||||
"submit": 1,
|
||||
"write": 1
|
||||
},
|
||||
@@ -248,6 +247,15 @@
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm"
|
||||
"doctype": "DocPerm",
|
||||
"role": "System Manager"
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm",
|
||||
"role": "Manufacturing Manager"
|
||||
},
|
||||
{
|
||||
"doctype": "DocPerm",
|
||||
"role": "Manufacturing User"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user