[minor] [fix] price list currency read only and SO-MR mapping

This commit is contained in:
Nabin Hait
2013-07-23 15:31:39 +05:30
parent 648a5c7e33
commit 48a0bd3eda
13 changed files with 29 additions and 48 deletions

View File

@@ -74,14 +74,9 @@ erpnext.TransactionController = wn.ui.form.Controller.extend({
company: function() {
if(this.frm.doc.company && this.frm.fields_dict.currency) {
var me = this;
var company_currency = this.get_company_currency();
$.each(["currency", "price_list_currency"], function(i, fieldname) {
if(!me.frm.doc[fieldname]) {
me.frm.set_value(fieldname, company_currency);
me.script_manager.trigger(fieldname);
}
});
this.frm.set_value("currency", company_currency);
this.frm.script_manager.trigger("currency");
}
},
@@ -123,10 +118,9 @@ erpnext.TransactionController = wn.ui.form.Controller.extend({
if(this.frm.doc.price_list_name) {
this.frm.call({
method: "setup.utils.get_price_list_currency",
args: { args: {
args: {
price_list_name: this.frm.doc.price_list_name,
buying_or_selling: buying_or_selling
}},
},
callback: function(r) {
if(!r.exc) {
me.price_list_currency();

View File

@@ -20,7 +20,7 @@ $.extend(erpnext, {
if(!company && cur_frm)
company = cur_frm.doc.company;
if(company)
return wn.model.get(":Company", company).default_currency || wn.boot.sysdefaults.currency;
return wn.model.get_doc(":Company", company).default_currency || wn.boot.sysdefaults.currency;
else
return wn.boot.sysdefaults.currency;
},