Merge branch 'master' into edge

This commit is contained in:
Anand Doshi 2013-03-01 12:58:46 +05:30
commit db52264f83
9 changed files with 32 additions and 11 deletions

View File

@ -54,9 +54,6 @@ erpnext.buying.BuyingController = erpnext.utils.Controller.extend({
},
price_list_name: function(callback_fn) {
this.frm.toggle_reqd(["price_list_currency", "plc_conversion_rate"],
!!(this.frm.doc.price_list_name));
var me = this;
if(this.frm.doc.price_list_name) {
@ -137,6 +134,9 @@ erpnext.buying.BuyingController = erpnext.utils.Controller.extend({
},
price_list_currency: function() {
this.frm.toggle_reqd("plc_conversion_rate",
!!(this.frm.doc.price_list_name && this.frm.doc.price_list_currency));
this.set_dynamic_labels();
if(this.frm.doc.price_list_currency === this.get_company_currency())

View File

@ -53,7 +53,7 @@ def get_item_details(args):
"qty": 0,
"stock_uom": item.stock_uom,
"uom": item.stock_uom,
"conversion_factor": 1,
"conversion_factor": 1.0,
"warehouse": args.warehouse or item.default_warehouse,
"item_tax_rate": json.dumps(dict(([d.tax_type, d.tax_rate] for d in
item_wrapper.doclist.get({"parentfield": "item_tax"})))),

View File

@ -331,7 +331,12 @@ class BuyingController(AccountsController):
# update valuation rate
def update_valuation_rate(self, parentfield):
for d in self.doclist.get({"parentfield": parentfield}):
if d.qty:
d.conversion_factor = d.conversion_factor or webnotes.conn.get_value(
"UOM Conversion Detail", {"parent": d.item_code, "uom": d.uom},
"conversion_factor") or 1
if d.item_code and d.qty:
# if no item code, which is sometimes the case in purchase invoice,
# then it is not possible to track valuation against it
d.valuation_rate = (flt(d.purchase_rate or d.rate)
+ (flt(d.item_tax_amount) + flt(d.rm_supp_cost)) / flt(d.qty)
) / flt(d.conversion_factor)

View File

View File

@ -0,0 +1,6 @@
import webnotes
def execute():
webnotes.conn.sql("""update `tabPurchase Order Item` set prevdoc_doctype = 'Material Request'
where prevdoc_doctype = 'Purchase Request'""")
webnotes.conn.sql("""update `tabSupplier Quotation Item`
set prevdoc_doctype = 'Material Request' where prevdoc_doctype = 'Purchase Request'""")

View File

@ -201,4 +201,5 @@ patch_list = [
'execute:webnotes.reload_doc("accounts", "Print Format", "Sales Invoice Spartan") # 2013-02-26',
"execute:(not webnotes.conn.exists('Role', 'Projects Manager')) and webnotes.doc({'doctype':'Role', 'role_name':'Projects Manager'}).insert()",
"patches.february_2013.p09_remove_cancelled_warehouses",
"patches.march_2013.update_po_prevdoc_doctype",
]

View File

@ -40,7 +40,7 @@ def get_price_list_currency(args):
if isinstance(args, basestring):
args = json.loads(args)
result = webnotes.conn.sql("""select ref_currency from `tabItem Price`
result = webnotes.conn.sql("""select distinct ref_currency from `tabItem Price`
where price_list_name=%s and `%s`=1""" % ("%s", args.get("use_for")),
(args.get("price_list_name"),))
if result and len(result)==1:

View File

@ -1,15 +1,17 @@
[
{
"creation": "2013-01-10 16:34:25",
"creation": "2013-03-01 08:21:54",
"docstatus": 0,
"modified": "2013-01-29 13:40:32",
"modified": "2013-03-01 08:22:16",
"modified_by": "Administrator",
"owner": "harshada@webnotestech.com"
},
{
"allow_attach": 1,
"autoname": "field:batch_id",
"doctype": "DocType",
"document_type": "Master",
"max_attachments": 5,
"module": "Stock",
"name": "__common__"
},
@ -105,6 +107,15 @@
"oldfieldtype": "Small Text",
"read_only": 1
},
{
"doctype": "DocField",
"fieldname": "file_list",
"fieldtype": "Text",
"hidden": 1,
"label": "File List",
"no_copy": 1,
"print_hide": 1
},
{
"doctype": "DocPerm"
}

View File

@ -22,13 +22,11 @@ cur_frm.cscript.refresh = function(doc) {
if ((!doc.__islocal) && (doc.is_stock_item == 'Yes')) {
var callback = function(r, rt) {
var enabled = (r.message == 'exists') ? false : true;
var enabled = (r.message == 'exists') ? false : true;
cur_frm.toggle_enable(['has_serial_no', 'is_stock_item', 'valuation_method'], enabled);
}
$c_obj(make_doclist(doc.doctype, doc.name),'check_if_sle_exists','',callback);
}
cur_frm.cscript.hide_website_fields(doc);
}
cur_frm.cscript.item_code = function(doc) {