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

Conflicts:
	accounts/doctype/account/account.py
	accounts/doctype/gl_entry/gl_entry.py
	accounts/doctype/period_closing_voucher/period_closing_voucher.py
	stock/doctype/delivery_note/delivery_note.py
	stock/doctype/landed_cost_wizard/landed_cost_wizard.py
	stock/doctype/purchase_receipt/purchase_receipt.py
	stock/doctype/stock_ledger/stock_ledger.py
	stock/doctype/warehouse/warehouse.py
	stock/stock_ledger.py
This commit is contained in:
Anand Doshi
2013-09-25 19:55:41 +05:30
242 changed files with 3879 additions and 3910 deletions

View File

@@ -88,6 +88,7 @@ class DocType(BuyingController):
def update_bin(self, is_submit, is_stopped = 0):
from stock.utils import update_bin
pc_obj = get_obj('Purchase Common')
for d in getlist(self.doclist, 'po_details'):
#1. Check if is_stock_item == 'Yes'
@@ -122,12 +123,13 @@ class DocType(BuyingController):
# Update ordered_qty and indented_qty in bin
args = {
"item_code" : d.item_code,
"ordered_qty" : (is_submit and 1 or -1) * flt(po_qty),
"indented_qty" : (is_submit and 1 or -1) * flt(ind_qty),
"item_code": d.item_code,
"warehouse": d.warehouse,
"ordered_qty": (is_submit and 1 or -1) * flt(po_qty),
"indented_qty": (is_submit and 1 or -1) * flt(ind_qty),
"posting_date": self.doc.transaction_date
}
get_obj("Warehouse", d.warehouse).update_bin(args)
update_bin(args)
def check_modified_date(self):
mod_db = webnotes.conn.sql("select modified from `tabPurchase Order` where name = '%s'" % self.doc.name)

View File

@@ -1,11 +1,6 @@
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
// License: GNU General Public License v3. See license.txt
cur_frm.cscript.item_code = function(doc, cdt, cdn) {
if (doc.item_code)
return get_server_fields('get_purchase_receipt_item_details','','',doc,cdt,cdn,1);
}
cur_frm.cscript.inspection_type = function(doc, cdt, cdn) {
if(doc.inspection_type == 'Incoming'){
doc.delivery_note_no = '';
@@ -30,13 +25,22 @@ cur_frm.cscript.refresh = cur_frm.cscript.inspection_type;
// item code based on GRN/DN
cur_frm.fields_dict['item_code'].get_query = function(doc, cdt, cdn) {
var filter = {};
if (doc.purchase_receipt_no) filter['parent'] = doc.purchase_receipt_no;
else if (doc.delivery_note_no) filter['parent'] = doc.delivery_note_no;
return{
filters: filter
if (doc.purchase_receipt_no) {
return {
query: "buying.doctype.quality_inspection.quality_inspection.item_query",
filters: {
"from": "Purchase Receipt Item",
"parent": doc.purchase_receipt_no
}
}
} else if (doc.delivery_note_no) {
return {
query: "buying.doctype.quality_inspection.quality_inspection.item_query",
filters: {
"from": "Delivery Note Item",
"parent": doc.delivery_note_no
}
}
}
}

View File

@@ -33,3 +33,17 @@ class DocType:
webnotes.conn.sql("update `tabPurchase Receipt Item` t1, `tabPurchase Receipt` t2 set t1.qa_no = '', t2.modified = '%s' \
where t1.parent = '%s' and t1.item_code = '%s' and t1.parent = t2.name" \
% (self.doc.modified, self.doc.purchase_receipt_no, self.doc.item_code))
def item_query(doctype, txt, searchfield, start, page_len, filters):
if filters.get("from"):
from webnotes.widgets.reportview import get_match_cond
filters.update({
"txt": txt,
"mcond": get_match_cond(filters["from"], searchfield),
"start": start,
"page_len": page_len
})
return webnotes.conn.sql("""select item_code from `tab%(from)s`
where parent='%(parent)s' and docstatus < 2 and item_code like '%%%(txt)s%%' %(mcond)s
order by item_code limit %(start)s, %(page_len)s""" % filters)

View File

@@ -98,8 +98,8 @@ def _get_price_list_rate(args, item_bean, meta):
from utilities.transaction_base import validate_currency
validate_currency(args, item_bean.doc, meta)
out.import_ref_rate = \
flt(price_list_rate[0].ref_rate * args.plc_conversion_rate / args.conversion_rate)
out.import_ref_rate = flt(price_list_rate[0].ref_rate) * \
flt(args.plc_conversion_rate) / flt(args.conversion_rate)
# if not found, fetch from last purchase transaction
if not out.import_ref_rate: