fixes in bom
This commit is contained in:
parent
e2639197de
commit
9e95f8c201
@ -67,7 +67,7 @@ var get_bom_material_detail= function(doc,dt,dn) {
|
|||||||
calculate_total(doc);
|
calculate_total(doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
var bom_no = (d.bom_no!=null) ? d.bom_no:''
|
var bom_no = (d.bom_no!=null) ? d.bom_no: ''
|
||||||
if (d.item_code) {
|
if (d.item_code) {
|
||||||
arg = {'item_code': d.item_code, 'bom_no': bom_no, 'qty': d.qty};
|
arg = {'item_code': d.item_code, 'bom_no': bom_no, 'qty': d.qty};
|
||||||
get_server_fields('get_bom_material_detail', JSON.stringify(arg), 'bom_materials', doc, dt, dn, 1, callback);
|
get_server_fields('get_bom_material_detail', JSON.stringify(arg), 'bom_materials', doc, dt, dn, 1, callback);
|
||||||
|
@ -31,7 +31,8 @@ class DocType:
|
|||||||
self.doclist = doclist
|
self.doclist = doclist
|
||||||
|
|
||||||
def autoname(self):
|
def autoname(self):
|
||||||
last_name = sql("select max(name) from `tabBOM` where name like 'BOM/%s/%%'" % self.doc.item)
|
last_name = sql("""select max(name) from `tabBOM`
|
||||||
|
where name like 'BOM/%s/%%'""" % self.doc.item)
|
||||||
if last_name:
|
if last_name:
|
||||||
idx = cint(cstr(last_name[0][0]).split('/')[-1]) + 1
|
idx = cint(cstr(last_name[0][0]).split('/')[-1]) + 1
|
||||||
else:
|
else:
|
||||||
@ -40,9 +41,10 @@ class DocType:
|
|||||||
|
|
||||||
|
|
||||||
def get_item_det(self, item_code):
|
def get_item_det(self, item_code):
|
||||||
item = sql("""select name, is_asset_item, is_purchase_item, docstatus, is_sub_contracted_item,
|
item = sql("""select name, is_asset_item, is_purchase_item, docstatus,
|
||||||
description, stock_uom, default_bom, last_purchase_rate, standard_rate, is_manufactured_item from `tabItem`
|
is_sub_contracted_item, description, stock_uom, default_bom,
|
||||||
where item_code = %s""", item_code, as_dict = 1)
|
last_purchase_rate, standard_rate, is_manufactured_item
|
||||||
|
from `tabItem` where item_code = %s""", item_code, as_dict = 1)
|
||||||
|
|
||||||
return item
|
return item
|
||||||
|
|
||||||
@ -86,8 +88,8 @@ class DocType:
|
|||||||
|
|
||||||
def get_bom_material_detail(self, arg):
|
def get_bom_material_detail(self, arg):
|
||||||
""" Get raw material details like uom, desc and rate"""
|
""" Get raw material details like uom, desc and rate"""
|
||||||
|
import json
|
||||||
arg = eval(arg)
|
arg = json.loads(arg)
|
||||||
item = self.get_item_det(arg['item_code'])
|
item = self.get_item_det(arg['item_code'])
|
||||||
self.validate_rm_item(item)
|
self.validate_rm_item(item)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user