Merge branch 'master' of github.com:webnotes/erpnext

This commit is contained in:
Anand Doshi 2013-04-16 20:58:41 +05:30
commit aa7a386db9
3 changed files with 9 additions and 12 deletions

View File

@ -242,4 +242,5 @@ patch_list = [
"execute:webnotes.delete_doc('Search Criteria', 'time_log_summary')",
"patches.april_2013.p04_update_role_in_pages",
"patches.april_2013.p05_fixes_in_reverse_modules",
"execute:webnotes.reload_doc('stock', 'DocType Mapper', 'Delivery Note-Packing Slip')"
]

View File

@ -2,7 +2,7 @@
{
"creation": "2012-02-02 11:50:33",
"docstatus": 0,
"modified": "2013-04-05 16:08:22",
"modified": "2013-04-16 12:26:28",
"modified_by": "Administrator",
"owner": "Administrator"
},
@ -60,6 +60,13 @@
"match_id": 1,
"to_field": "dn_detail"
},
{
"doctype": "Field Mapper Detail",
"from_field": "eval: flt(obj.qty) - flt(obj.packed_qty)",
"map": "Yes",
"match_id": 1,
"to_field": "qty"
},
{
"doctype": "Table Mapper Detail",
"from_table": "Delivery Note",

View File

@ -185,17 +185,6 @@ class DocType:
def set_item_details(self, row):
res = webnotes.conn.sql("""SELECT item_name, SUM(IFNULL(qty, 0)) as total_qty,
IFNULL(packed_qty, 0) as packed_qty, stock_uom
FROM `tabDelivery Note Item`
WHERE parent=%s AND item_code=%s GROUP BY item_code""",
(self.doc.delivery_note, row.item_code), as_dict=1)
if res and len(res)>0:
qty = res[0]['total_qty'] - res[0]['packed_qty']
if not row.qty:
row.qty = qty >= 0 and qty or 0
res = webnotes.conn.sql("""SELECT net_weight, weight_uom FROM `tabItem`
WHERE name=%s""", row.item_code, as_dict=1)