supplier part number in purchase order
diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.py b/erpnext/buying/doctype/purchase_common/purchase_common.py
index fd02b02..7240a2d 100644
--- a/erpnext/buying/doctype/purchase_common/purchase_common.py
+++ b/erpnext/buying/doctype/purchase_common/purchase_common.py
@@ -131,7 +131,7 @@
'warehouse': wh,
'item_tax_rate': json.dumps(t),
'batch_no': '',
- 'discount_rate': 0
+ 'discount_rate': 0
}
# get min_order_qty from item
@@ -170,6 +170,14 @@
'import_rate': 0,
})
+ if obj.doc.doctype == 'Purchase Order':
+ supplier_part_no = webnotes.conn.sql("""\
+ select supplier_part_no from `tabItem Supplier`
+ where parent = %s and parenttype = 'Item' and
+ supplier = %s""", (arg['item_code'], obj.doc.supplier))
+ if supplier_part_no and supplier_part_no[0][0]:
+ ret['supplier_part_no'] = supplier_part_no[0][0]
+
return ret
# Get Available Qty at Warehouse
diff --git a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.txt b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.txt
index 499cdef..73a6f01 100755
--- a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.txt
+++ b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.txt
@@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
- 'creation': '2012-03-27 14:35:50',
+ 'creation': '2012-05-15 12:14:38',
'docstatus': 0,
- 'modified': '2012-03-27 14:35:50',
+ 'modified': '2012-06-29 13:05:33',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
@@ -22,7 +22,7 @@
'section_style': u'Tray',
'server_code_error': u' ',
'show_in_menu': 0,
- 'version': 65
+ 'version': 1
},
# These values are common for all DocField
@@ -76,6 +76,19 @@
# DocField
{
+ 'colour': u'White:FFF',
+ 'description': u'If Supplier Part Number exists for given Item, it gets stored here',
+ 'doctype': u'DocField',
+ 'fieldname': u'supplier_part_no',
+ 'fieldtype': u'Data',
+ 'hidden': 1,
+ 'label': u'Supplier Part Number',
+ 'permlevel': 1,
+ 'print_hide': 1
+ },
+
+ # DocField
+ {
'doctype': u'DocField',
'fieldname': u'item_name',
'fieldtype': u'Data',
@@ -453,4 +466,4 @@
'permlevel': 0,
'print_hide': 1
}
-]
+]
\ No newline at end of file