Merge branch 'master' of github.com:webnotes/erpnext
diff --git a/accounts/doctype/pos_setting/pos_setting.js b/accounts/doctype/pos_setting/pos_setting.js
index 62549bb..653b631 100755
--- a/accounts/doctype/pos_setting/pos_setting.js
+++ b/accounts/doctype/pos_setting/pos_setting.js
@@ -18,8 +18,10 @@
$c_obj(make_doclist(cdt,cdn),'get_series','',function(r,rt){
if(r.message) set_field_options('naming_series', r.message);
});
-
+ cur_frm.set_query("price_list_name", function() {
+ return { filters: { buying_or_selling: "Selling" } };
+ });
}
//cash bank account
diff --git a/accounts/doctype/pos_setting/pos_setting.txt b/accounts/doctype/pos_setting/pos_setting.txt
index 4454973..d827490 100755
--- a/accounts/doctype/pos_setting/pos_setting.txt
+++ b/accounts/doctype/pos_setting/pos_setting.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-24 12:15:51",
"docstatus": 0,
- "modified": "2013-07-05 14:50:33",
+ "modified": "2013-07-26 11:16:53",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -94,11 +94,11 @@
{
"doctype": "DocField",
"fieldname": "price_list_name",
- "fieldtype": "Select",
+ "fieldtype": "Link",
"label": "Price List",
"oldfieldname": "price_list_name",
"oldfieldtype": "Select",
- "options": "link:Price List",
+ "options": "Price List",
"read_only": 0,
"reqd": 1
},
diff --git a/accounts/doctype/sales_invoice/sales_invoice.txt b/accounts/doctype/sales_invoice/sales_invoice.txt
index 625d2c9..acc9ebe 100644
--- a/accounts/doctype/sales_invoice/sales_invoice.txt
+++ b/accounts/doctype/sales_invoice/sales_invoice.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-24 19:29:05",
"docstatus": 0,
- "modified": "2013-07-25 16:08:10",
+ "modified": "2013-07-26 11:16:58",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -247,11 +247,11 @@
{
"doctype": "DocField",
"fieldname": "price_list_name",
- "fieldtype": "Select",
+ "fieldtype": "Link",
"label": "Price List",
"oldfieldname": "price_list_name",
"oldfieldtype": "Select",
- "options": "link:Price List",
+ "options": "Price List",
"print_hide": 1,
"read_only": 0,
"reqd": 1
diff --git a/patches/july_2013/p08_custom_print_format_net_total_export.py b/patches/july_2013/p08_custom_print_format_net_total_export.py
index a6a8335..c848ac9 100644
--- a/patches/july_2013/p08_custom_print_format_net_total_export.py
+++ b/patches/july_2013/p08_custom_print_format_net_total_export.py
@@ -3,13 +3,14 @@
import re
def execute():
- for name, html in webnotes.conn.sql("""select name, html from `tabPrint Format` where standard='No'"""):
- changed = False
- for match in re.findall("(doc.net_total.*doc.conversion_rate)", html):
- if match.replace(" ", "") == "doc.net_total/doc.conversion_rate":
- html = html.replace(match, "doc.net_total_export")
- changed = True
+ for name, html in webnotes.conn.sql("""select name, html from `tabPrint Format` where standard='No'
+ and ifnull(html, '')!=''"""):
+ changed = False
+ for match in re.findall("(doc.net_total.*doc.conversion_rate)", html):
+ if match.replace(" ", "") == "doc.net_total/doc.conversion_rate":
+ html = html.replace(match, "doc.net_total_export")
+ changed = True
- if changed:
- webnotes.conn.set_value("Print Format", name, "html", html)
+ if changed:
+ webnotes.conn.set_value("Print Format", name, "html", html)
\ No newline at end of file
diff --git a/selling/doctype/quotation/quotation.txt b/selling/doctype/quotation/quotation.txt
index 7f16466..7949c03 100644
--- a/selling/doctype/quotation/quotation.txt
+++ b/selling/doctype/quotation/quotation.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-24 19:29:08",
"docstatus": 0,
- "modified": "2013-07-23 15:27:53",
+ "modified": "2013-07-26 11:16:53",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -281,12 +281,12 @@
"description": "Select the price list as entered in \"Price List\" master. This will pull the reference rates of items against this price list as specified in \"Item\" master.",
"doctype": "DocField",
"fieldname": "price_list_name",
- "fieldtype": "Select",
+ "fieldtype": "Link",
"in_filter": 1,
"label": "Price List",
"oldfieldname": "price_list_name",
"oldfieldtype": "Select",
- "options": "link:Price List",
+ "options": "Price List",
"print_hide": 1,
"read_only": 0,
"reqd": 1,
diff --git a/selling/doctype/sales_common/sales_common.js b/selling/doctype/sales_common/sales_common.js
index 246d4a1..dbd0a1a 100644
--- a/selling/doctype/sales_common/sales_common.js
+++ b/selling/doctype/sales_common/sales_common.js
@@ -70,6 +70,22 @@
this.frm.fields_dict.lead && this.frm.set_query("lead", function(doc,cdt,cdn) {
return{ query:"controllers.queries.lead_query" } });
+ if(this.frm.fields_dict.price_list_name) {
+ this.frm.set_query("price_list_name", function() {
+ return { filters: { buying_or_selling: "Selling" } };
+ });
+
+ this.frm.set_query("price_list_currency", function() {
+ return {
+ query: "controllers.queries.get_price_list_currency",
+ filters: {
+ price_list_name: me.frm.doc.price_list_name,
+ buying_or_selling: "Selling"
+ }
+ };
+ });
+ }
+
if(!this.fname) {
return;
}
diff --git a/selling/doctype/sales_order/sales_order.txt b/selling/doctype/sales_order/sales_order.txt
index 3e6cbe4..8c27b60 100644
--- a/selling/doctype/sales_order/sales_order.txt
+++ b/selling/doctype/sales_order/sales_order.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-06-18 12:39:59",
"docstatus": 0,
- "modified": "2013-07-23 15:27:39",
+ "modified": "2013-07-26 11:16:55",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -294,11 +294,11 @@
"description": "Select the price list as entered in \"Price List\" master. This will pull the reference rates of items against this price list as specified in \"Item\" master.",
"doctype": "DocField",
"fieldname": "price_list_name",
- "fieldtype": "Select",
+ "fieldtype": "Link",
"label": "Price List",
"oldfieldname": "price_list_name",
"oldfieldtype": "Select",
- "options": "link:Price List",
+ "options": "Price List",
"print_hide": 1,
"reqd": 1,
"width": "100px"
diff --git a/setup/doctype/price_list/price_list.txt b/setup/doctype/price_list/price_list.txt
index 1af2e1b..febf471 100644
--- a/setup/doctype/price_list/price_list.txt
+++ b/setup/doctype/price_list/price_list.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-25 11:35:09",
"docstatus": 0,
- "modified": "2013-07-23 12:03:25",
+ "modified": "2013-07-26 11:19:06",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -55,6 +55,7 @@
"doctype": "DocField",
"fieldname": "currency",
"fieldtype": "Link",
+ "in_list_view": 1,
"label": "Currency",
"options": "Currency",
"reqd": 1
@@ -64,6 +65,7 @@
"doctype": "DocField",
"fieldname": "buying_or_selling",
"fieldtype": "Select",
+ "in_list_view": 1,
"label": "Valid for Buying or Selling?",
"options": "Buying\nSelling",
"reqd": 1
diff --git a/stock/doctype/delivery_note/delivery_note.txt b/stock/doctype/delivery_note/delivery_note.txt
index aa9530f..3008b79 100644
--- a/stock/doctype/delivery_note/delivery_note.txt
+++ b/stock/doctype/delivery_note/delivery_note.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-24 19:29:09",
"docstatus": 0,
- "modified": "2013-07-23 15:28:18",
+ "modified": "2013-07-26 11:16:57",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -286,11 +286,11 @@
"description": "Select the price list as entered in \"Price List\" master. This will pull the reference rates of items against this price list as specified in \"Item\" master.",
"doctype": "DocField",
"fieldname": "price_list_name",
- "fieldtype": "Select",
+ "fieldtype": "Link",
"label": "Price List",
"oldfieldname": "price_list_name",
"oldfieldtype": "Select",
- "options": "link:Price List",
+ "options": "Price List",
"print_hide": 1,
"read_only": 0,
"reqd": 1
diff --git a/utilities/transaction_base.py b/utilities/transaction_base.py
index 55421a1..fc746c4 100644
--- a/utilities/transaction_base.py
+++ b/utilities/transaction_base.py
@@ -95,7 +95,7 @@
self.doc.price_list
for fieldname, val in customer_defaults.items():
- if not self.doc.fields.get(fieldname) and self.meta.get_field(fieldname):
+ if self.meta.get_field(fieldname):
self.doc.fields[fieldname] = val
if self.meta.get_field("sales_team"):
@@ -135,7 +135,7 @@
def set_supplier_defaults(self):
for fieldname, val in self.get_supplier_defaults().items():
- if not self.doc.fields.get(fieldname) and self.meta.get_field(fieldname):
+ if self.meta.get_field(fieldname):
self.doc.fields[fieldname] = val
def get_lead_defaults(self):