[minor] save last company in multi-company scenario

This commit is contained in:
Rushabh Mehta
2015-04-28 16:02:09 +05:30
parent b1b95526c6
commit 45ca8a4d31
4 changed files with 20 additions and 10 deletions

View File

@@ -190,8 +190,11 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
if (this.frm.doc.posting_date) var date = this.frm.doc.posting_date;
else var date = this.frm.doc.transaction_date;
erpnext.get_fiscal_year(this.frm.doc.company, date, fn);
erpnext.get_letter_head(this.frm.doc.company);
if(this.frm.doc.company) {
erpnext.last_selected_company = this.frm.doc.company;
}
},
transaction_date: function() {

View File

@@ -41,6 +41,8 @@ $.extend(erpnext, {
if(companies.length === 1) {
if(!cur_frm.doc.company) cur_frm.set_value("company", companies[0]);
cur_frm.toggle_display("company", false);
} else if(erpnext.last_selected_company) {
if(!cur_frm.doc.company) cur_frm.set_value("company", erpnext.last_selected_company);
}
}
},
@@ -76,8 +78,8 @@ $.extend(erpnext, {
"options": "Serial No",
"label": __("Serial No"),
"get_query": function () {
return {
filters: {
return {
filters: {
item_code:grid_row.doc.item_code ,
warehouse:grid_row.doc.warehouse
}