[fix] [minor] fixed conflict while merging with master

This commit is contained in:
Nabin Hait
2013-08-19 11:06:06 +05:30
206 changed files with 5830 additions and 1272 deletions

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:22",
"docstatus": 0,
"modified": "2013-07-05 14:25:35",
"modified": "2013-08-07 14:44:52",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -141,7 +141,6 @@
"options": "Profile"
},
{
"default": "0.00",
"doctype": "DocField",
"fieldname": "value",
"fieldtype": "Float",

View File

@@ -121,8 +121,7 @@ class DocType:
def get_current(self, arg=None):
"""get series current"""
self.doc.current_value = webnotes.conn.sql("""select current from tabSeries where name=%s""",
self.doc.prefix)[0][0]
self.doc.current_value = webnotes.conn.get_value("Series", self.doc.prefix, "current")
def insert_series(self, series):
"""insert series if missing"""

View File

@@ -19,7 +19,7 @@ $.extend(cur_frm.cscript, {
},
show_item_prices: function() {
var item_price = wn.model.get("Item Price", {price_list_name: cur_frm.doc.name});
var item_price = wn.model.get("Item Price", {price_list: cur_frm.doc.name});
var show = item_price && item_price.length;

View File

@@ -11,7 +11,7 @@ import webnotes.defaults
class DocType(DocListController):
def onload(self):
self.doclist.extend(webnotes.conn.sql("""select * from `tabItem Price`
where price_list_name=%s""", self.doc.name, as_dict=True, update={"doctype": "Item Price"}))
where price_list=%s""", self.doc.name, as_dict=True, update={"doctype": "Item Price"}))
def validate(self):
if self.doc.buying_or_selling not in ["Buying", "Selling"]:
@@ -31,10 +31,20 @@ class DocType(DocListController):
self.validate_table_has_rows("valid_for_territories")
def on_update(self):
self.set_default_if_missing()
cart_settings = webnotes.get_obj("Shopping Cart Settings")
if cint(cart_settings.doc.enabled):
cart_settings.validate_price_lists()
def on_trash(self):
webnotes.conn.sql("""delete from `tabItem Price` where price_list_name = %s""",
self.doc.name)
webnotes.conn.sql("""delete from `tabItem Price` where price_list = %s""",
self.doc.name)
def set_default_if_missing(self):
if self.doc.buying_or_selling=="Selling":
if not webnotes.conn.get_value("Selling Settings", None, "selling_price_list"):
webnotes.set_value("Selling Settings", "Selling Settings", "selling_price_list", self.doc.name)
elif self.doc.buying_or_selling=="Buying":
if not webnotes.conn.get_value("Buying Settings", None, "buying_price_list"):
webnotes.set_value("Buying Settings", "Buying Settings", "buying_price_list", self.doc.name)

View File

@@ -31,6 +31,6 @@ def get_ancestors_of(doctype, name):
return result or []
@webnotes.whitelist()
def get_price_list_currency(price_list_name):
return {"price_list_currency": webnotes.conn.get_value("Price List", price_list_name,
def get_price_list_currency(price_list):
return {"price_list_currency": webnotes.conn.get_value("Price List", price_list,
"currency")}