Merge branch 'master' into edge
This commit is contained in:
commit
db52264f83
@ -54,9 +54,6 @@ erpnext.buying.BuyingController = erpnext.utils.Controller.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
price_list_name: function(callback_fn) {
|
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;
|
var me = this;
|
||||||
|
|
||||||
if(this.frm.doc.price_list_name) {
|
if(this.frm.doc.price_list_name) {
|
||||||
@ -137,6 +134,9 @@ erpnext.buying.BuyingController = erpnext.utils.Controller.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
price_list_currency: function() {
|
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();
|
this.set_dynamic_labels();
|
||||||
|
|
||||||
if(this.frm.doc.price_list_currency === this.get_company_currency())
|
if(this.frm.doc.price_list_currency === this.get_company_currency())
|
||||||
|
|||||||
@ -53,7 +53,7 @@ def get_item_details(args):
|
|||||||
"qty": 0,
|
"qty": 0,
|
||||||
"stock_uom": item.stock_uom,
|
"stock_uom": item.stock_uom,
|
||||||
"uom": item.stock_uom,
|
"uom": item.stock_uom,
|
||||||
"conversion_factor": 1,
|
"conversion_factor": 1.0,
|
||||||
"warehouse": args.warehouse or item.default_warehouse,
|
"warehouse": args.warehouse or item.default_warehouse,
|
||||||
"item_tax_rate": json.dumps(dict(([d.tax_type, d.tax_rate] for d in
|
"item_tax_rate": json.dumps(dict(([d.tax_type, d.tax_rate] for d in
|
||||||
item_wrapper.doclist.get({"parentfield": "item_tax"})))),
|
item_wrapper.doclist.get({"parentfield": "item_tax"})))),
|
||||||
|
|||||||
@ -331,7 +331,12 @@ class BuyingController(AccountsController):
|
|||||||
# update valuation rate
|
# update valuation rate
|
||||||
def update_valuation_rate(self, parentfield):
|
def update_valuation_rate(self, parentfield):
|
||||||
for d in self.doclist.get({"parentfield": 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)
|
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.item_tax_amount) + flt(d.rm_supp_cost)) / flt(d.qty)
|
||||||
) / flt(d.conversion_factor)
|
) / flt(d.conversion_factor)
|
||||||
|
|||||||
0
patches/march_2013/__init__.py
Normal file
0
patches/march_2013/__init__.py
Normal file
6
patches/march_2013/update_po_prevdoc_doctype.py
Normal file
6
patches/march_2013/update_po_prevdoc_doctype.py
Normal 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'""")
|
||||||
@ -201,4 +201,5 @@ patch_list = [
|
|||||||
'execute:webnotes.reload_doc("accounts", "Print Format", "Sales Invoice Spartan") # 2013-02-26',
|
'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()",
|
"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.february_2013.p09_remove_cancelled_warehouses",
|
||||||
|
"patches.march_2013.update_po_prevdoc_doctype",
|
||||||
]
|
]
|
||||||
@ -40,7 +40,7 @@ def get_price_list_currency(args):
|
|||||||
if isinstance(args, basestring):
|
if isinstance(args, basestring):
|
||||||
args = json.loads(args)
|
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")),
|
where price_list_name=%s and `%s`=1""" % ("%s", args.get("use_for")),
|
||||||
(args.get("price_list_name"),))
|
(args.get("price_list_name"),))
|
||||||
if result and len(result)==1:
|
if result and len(result)==1:
|
||||||
|
|||||||
@ -1,15 +1,17 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"creation": "2013-01-10 16:34:25",
|
"creation": "2013-03-01 08:21:54",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"modified": "2013-01-29 13:40:32",
|
"modified": "2013-03-01 08:22:16",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"owner": "harshada@webnotestech.com"
|
"owner": "harshada@webnotestech.com"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_attach": 1,
|
||||||
"autoname": "field:batch_id",
|
"autoname": "field:batch_id",
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"document_type": "Master",
|
"document_type": "Master",
|
||||||
|
"max_attachments": 5,
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "__common__"
|
"name": "__common__"
|
||||||
},
|
},
|
||||||
@ -105,6 +107,15 @@
|
|||||||
"oldfieldtype": "Small Text",
|
"oldfieldtype": "Small Text",
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"doctype": "DocField",
|
||||||
|
"fieldname": "file_list",
|
||||||
|
"fieldtype": "Text",
|
||||||
|
"hidden": 1,
|
||||||
|
"label": "File List",
|
||||||
|
"no_copy": 1,
|
||||||
|
"print_hide": 1
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"doctype": "DocPerm"
|
"doctype": "DocPerm"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,13 +22,11 @@ cur_frm.cscript.refresh = function(doc) {
|
|||||||
|
|
||||||
if ((!doc.__islocal) && (doc.is_stock_item == 'Yes')) {
|
if ((!doc.__islocal) && (doc.is_stock_item == 'Yes')) {
|
||||||
var callback = function(r, rt) {
|
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);
|
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);
|
$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) {
|
cur_frm.cscript.item_code = function(doc) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user