mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 04:09:11 +00:00
[price list] Separated Default Price List for Selling and Buying and changed fieldnames
This commit is contained in:
@@ -111,7 +111,7 @@ test_records = [
|
||||
"posting_date": "2013-02-21",
|
||||
"posting_time": "9:00:00",
|
||||
"price_list_currency": "INR",
|
||||
"price_list_name": "_Test Price List",
|
||||
"selling_price_list": "_Test Price List",
|
||||
"status": "Draft",
|
||||
"territory": "_Test Territory",
|
||||
"net_total": 500.0,
|
||||
|
||||
@@ -5,16 +5,16 @@ wn.provide("erpnext.stock");
|
||||
|
||||
erpnext.stock.Item = wn.ui.form.Controller.extend({
|
||||
onload: function() {
|
||||
this.frm.add_fetch("price_list_name", "currency", "ref_currency");
|
||||
this.frm.add_fetch("price_list_name", "buying_or_selling", "buying_or_selling");
|
||||
this.frm.add_fetch("price_list", "currency", "ref_currency");
|
||||
this.frm.add_fetch("price_list", "buying_or_selling", "buying_or_selling");
|
||||
},
|
||||
|
||||
ref_rate_details_add: function(doc, cdt, cdn) {
|
||||
var row = wn.model.get_doc(cdt, cdn);
|
||||
if(row.price_list_name && !row.ref_currency) {
|
||||
if(row.price_list && !row.ref_currency) {
|
||||
// execute fetch
|
||||
var df = wn.meta.get_docfield(row.doctype, "price_list_name", row.parent);
|
||||
this.frm.script_manager.validate_link_and_fetch(df, row.name, row.price_list_name);
|
||||
var df = wn.meta.get_docfield(row.doctype, "price_list", row.parent);
|
||||
this.frm.script_manager.validate_link_and_fetch(df, row.name, row.price_list);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -130,16 +130,16 @@ class DocType(DocListController):
|
||||
def validate_price_lists(self):
|
||||
price_lists=[]
|
||||
for d in getlist(self.doclist,'ref_rate_details'):
|
||||
if d.price_list_name in price_lists:
|
||||
msgprint(_("Cannot have two prices for same Price List") + ": " + d.price_list_name,
|
||||
if d.price_list in price_lists:
|
||||
msgprint(_("Cannot have two prices for same Price List") + ": " + d.price_list,
|
||||
raise_exception= webnotes.DuplicateEntryError)
|
||||
else:
|
||||
price_list_currency = webnotes.conn.get_value("Price List", d.price_list_name, "currency")
|
||||
price_list_currency = webnotes.conn.get_value("Price List", d.price_list, "currency")
|
||||
if price_list_currency and d.ref_currency != price_list_currency:
|
||||
msgprint(_("Currency does not match Price List Currency for Price List") \
|
||||
+ ": " + d.price_list_name, raise_exception=PriceListCurrencyMismatch)
|
||||
+ ": " + d.price_list, raise_exception=PriceListCurrencyMismatch)
|
||||
|
||||
price_lists.append(d.price_list_name)
|
||||
price_lists.append(d.price_list)
|
||||
|
||||
|
||||
def fill_customer_code(self):
|
||||
|
||||
@@ -61,7 +61,7 @@ test_records = [
|
||||
}, {
|
||||
"doctype": "Item Price",
|
||||
"parentfield": "ref_rate_details",
|
||||
"price_list_name": "_Test Price List",
|
||||
"price_list": "_Test Price List",
|
||||
"ref_rate": 100,
|
||||
"ref_currency": "INR",
|
||||
"buying_or_selling": "Selling"
|
||||
|
||||
@@ -244,7 +244,7 @@
|
||||
"print_hide": 1
|
||||
},
|
||||
{
|
||||
"depends_on": "price_list_name",
|
||||
"depends_on": "buying_price_list",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "price_list_currency",
|
||||
"fieldtype": "Link",
|
||||
@@ -255,7 +255,7 @@
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"depends_on": "price_list_name",
|
||||
"depends_on": "buying_price_list",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "plc_conversion_rate",
|
||||
"fieldtype": "Float",
|
||||
|
||||
Reference in New Issue
Block a user