Standard Rate field removed from item. Fixes #1688

This commit is contained in:
Nabin Hait 2014-05-29 16:18:49 +05:30
parent 732a7e81a0
commit e71159d6ea
4 changed files with 41 additions and 50 deletions

View File

@ -54,7 +54,7 @@ class BOM(Document):
def get_item_det(self, item_code): def get_item_det(self, item_code):
item = frappe.db.sql("""select name, is_asset_item, is_purchase_item, item = frappe.db.sql("""select name, is_asset_item, is_purchase_item,
docstatus, description, is_sub_contracted_item, stock_uom, default_bom, docstatus, description, is_sub_contracted_item, stock_uom, default_bom,
last_purchase_rate, standard_rate, is_manufactured_item last_purchase_rate, is_manufactured_item
from `tabItem` where name=%s""", item_code, as_dict = 1) from `tabItem` where name=%s""", item_code, as_dict = 1)
return item return item
@ -111,8 +111,6 @@ class BOM(Document):
frappe.throw(_("Please select Price List")) frappe.throw(_("Please select Price List"))
rate = frappe.db.get_value("Item Price", {"price_list": self.buying_price_list, rate = frappe.db.get_value("Item Price", {"price_list": self.buying_price_list,
"item_code": arg["item_code"]}, "price_list_rate") or 0 "item_code": arg["item_code"]}, "price_list_rate") or 0
elif self.rm_cost_as_per == 'Standard Rate':
rate = arg['standard_rate']
return rate return rate

View File

@ -1,5 +1,5 @@
{ {
"creation": "2013-02-22 01:27:49.000000", "creation": "2013-02-22 01:27:49",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"fields": [ "fields": [
@ -79,7 +79,8 @@
"fieldtype": "Float", "fieldtype": "Float",
"in_list_view": 1, "in_list_view": 1,
"label": "Rate", "label": "Rate",
"permlevel": 0 "permlevel": 0,
"reqd": 1
}, },
{ {
"fieldname": "col_break2", "fieldname": "col_break2",
@ -133,9 +134,12 @@
], ],
"idx": 1, "idx": 1,
"istable": 1, "istable": 1,
"modified": "2014-02-03 12:47:39.000000", "modified": "2014-05-29 15:56:31.859868",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Manufacturing", "module": "Manufacturing",
"name": "BOM Item", "name": "BOM Item",
"owner": "Administrator" "owner": "Administrator",
"permissions": [],
"sort_field": "modified",
"sort_order": "DESC"
} }

View File

@ -439,16 +439,6 @@
"permlevel": 0, "permlevel": 0,
"read_only": 1 "read_only": 1
}, },
{
"depends_on": "eval:doc.is_purchase_item==\"Yes\"",
"fieldname": "standard_rate",
"fieldtype": "Float",
"label": "Standard Rate",
"oldfieldname": "standard_rate",
"oldfieldtype": "Currency",
"permlevel": 0,
"read_only": 0
},
{ {
"depends_on": "eval:doc.is_purchase_item==\"Yes\"", "depends_on": "eval:doc.is_purchase_item==\"Yes\"",
"fieldname": "column_break2", "fieldname": "column_break2",
@ -835,7 +825,7 @@
"icon": "icon-tag", "icon": "icon-tag",
"idx": 1, "idx": 1,
"max_attachments": 1, "max_attachments": 1,
"modified": "2014-05-21 15:37:30.124881", "modified": "2014-05-29 16:05:53.126214",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Item", "name": "Item",

View File

@ -25,8 +25,7 @@ def execute(filters=None):
flt(val_rate_map.get(item, 0), precision), flt(val_rate_map.get(item, 0), precision),
pl.get(item, {}).get("Selling"), pl.get(item, {}).get("Selling"),
pl.get(item, {}).get("Buying"), pl.get(item, {}).get("Buying"),
flt(bom_rate.get(item, 0), precision), flt(bom_rate.get(item, 0), precision)
flt(item_map[item]["standard_rate"], precision)
]) ])
return columns, data return columns, data
@ -36,7 +35,7 @@ def get_columns(filters):
columns = ["Item:Link/Item:100", "Item Name::150", "Description::150", "UOM:Link/UOM:80", columns = ["Item:Link/Item:100", "Item Name::150", "Description::150", "UOM:Link/UOM:80",
"Last Purchase Rate:Currency:90", "Valuation Rate:Currency:80", "Sales Price List::80", "Last Purchase Rate:Currency:90", "Valuation Rate:Currency:80", "Sales Price List::80",
"Purchase Price List::80", "BOM Rate:Currency:90", "Standard Rate:Currency:100"] "Purchase Price List::80", "BOM Rate:Currency:90"]
return columns return columns
@ -46,7 +45,7 @@ def get_item_details():
item_map = {} item_map = {}
for i in frappe.db.sql("select name, item_name, description, \ for i in frappe.db.sql("select name, item_name, description, \
stock_uom, standard_rate from tabItem \ stock_uom from tabItem \
order by item_code", as_dict=1): order by item_code", as_dict=1):
item_map.setdefault(i.name, i) item_map.setdefault(i.name, i)