[fix] Error Reports

This commit is contained in:
Anand Doshi 2014-08-19 16:05:54 +05:30
parent 354acf6fc9
commit cca6460e65
3 changed files with 6 additions and 4 deletions

View File

@ -135,8 +135,10 @@ def get_pricing_rule_for_item(args):
frappe.throw(_("Item Group not mentioned in item master for item {0}").format(args.item_code)) frappe.throw(_("Item Group not mentioned in item master for item {0}").format(args.item_code))
if args.customer and not (args.customer_group and args.territory): if args.customer and not (args.customer_group and args.territory):
args.customer_group, args.territory = frappe.db.get_value("Customer", args.customer, customer = frappe.db.get_value("Customer", args.customer, ["customer_group", "territory"])
["customer_group", "territory"]) if customer:
args.customer_group, args.territory = customer
elif args.supplier and not args.supplier_type: elif args.supplier and not args.supplier_type:
args.supplier_type = frappe.db.get_value("Supplier", args.supplier, "supplier_type") args.supplier_type = frappe.db.get_value("Supplier", args.supplier, "supplier_type")

View File

@ -324,7 +324,7 @@ class ProductionPlanningTool(Document):
total_qty = sum([flt(d[0]) for d in so_item_qty]) total_qty = sum([flt(d[0]) for d in so_item_qty])
if total_qty > item_projected_qty.get(item, 0): if total_qty > item_projected_qty.get(item, 0):
# shortage # shortage
requested_qty = total_qty - item_projected_qty.get(item, 0) requested_qty = total_qty - flt(item_projected_qty.get(item))
# consider minimum order qty # consider minimum order qty
requested_qty = requested_qty > flt(so_item_qty[0][3]) and \ requested_qty = requested_qty > flt(so_item_qty[0][3]) and \
requested_qty or flt(so_item_qty[0][3]) requested_qty or flt(so_item_qty[0][3])

View File

@ -96,7 +96,7 @@ erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.exten
title: __("Get Items from BOM"), title: __("Get Items from BOM"),
fields: [ fields: [
{"fieldname":"bom", "fieldtype":"Link", "label":__("BOM"), {"fieldname":"bom", "fieldtype":"Link", "label":__("BOM"),
options:"BOM"}, options:"BOM", reqd: 1},
{"fieldname":"fetch_exploded", "fieldtype":"Check", {"fieldname":"fetch_exploded", "fieldtype":"Check",
"label":__("Fetch exploded BOM (including sub-assemblies)"), "default":1}, "label":__("Fetch exploded BOM (including sub-assemblies)"), "default":1},
{fieldname:"fetch", "label":__("Get Items from BOM"), "fieldtype":"Button"} {fieldname:"fetch", "label":__("Get Items from BOM"), "fieldtype":"Button"}