Merge pull request #4613 from nabinhait/fixes

[fix] Item query and exchange rate
This commit is contained in:
Rushabh Mehta 2016-01-15 11:19:44 +05:30
commit 2e3d2b8426
3 changed files with 13 additions and 10 deletions

View File

@ -611,8 +611,10 @@ def get_payment_entry_against_invoice(dt, dn, amount=None, journal_entry=False,
def get_payment_entry(ref_doc, args): def get_payment_entry(ref_doc, args):
cost_center = frappe.db.get_value("Company", ref_doc.company, "cost_center") cost_center = frappe.db.get_value("Company", ref_doc.company, "cost_center")
exchange_rate = get_exchange_rate(args.get("party_account"), args.get("party_account_currency"), exchange_rate = 1
ref_doc.company, ref_doc.doctype, ref_doc.name) if args.get("party_account"):
exchange_rate = get_exchange_rate(args.get("party_account"), args.get("party_account_currency"),
ref_doc.company, ref_doc.doctype, ref_doc.name)
je = frappe.new_doc("Journal Entry") je = frappe.new_doc("Journal Entry")
je.update({ je.update({

View File

@ -253,11 +253,10 @@ cur_frm.cscript['Update Finished Goods'] = function() {
cur_frm.fields_dict['production_item'].get_query = function(doc) { cur_frm.fields_dict['production_item'].get_query = function(doc) {
return { return {
filters:[ query: "erpnext.controllers.queries.item_query",
['Item', 'is_pro_applicable', '=', 1], filters:{
['Item', 'has_variants', '=', 0], 'is_pro_applicable': 1,
['Item', 'end_of_life', '>=', frappe.datetime.nowdate()] }
]
} }
} }

View File

@ -10,9 +10,11 @@ frappe.ui.form.on("Stock Reconciliation", {
// end of life // end of life
frm.set_query("item_code", "items", function(doc, cdt, cdn) { frm.set_query("item_code", "items", function(doc, cdt, cdn) {
return { return {
filters:[ query: "erpnext.controllers.queries.item_query",
['Item', 'end_of_life', '>=', frappe.datetime.nowdate()] filters:{
] "is_stock_item": 1,
"has_serial_no": 0
}
} }
}); });
}, },