Fix related to user_default

This commit is contained in:
Nabin Hait 2014-03-14 15:10:42 +05:30
parent 27bb7892b3
commit 73083dc960
18 changed files with 21 additions and 21 deletions

View File

@ -68,7 +68,7 @@ pscript['onload_Accounts Browser'] = function(wrapper){
$.each(r.message, function(i, v) {
$('<option>').html(v).attr('value', v).appendTo(wrapper.$company_select);
});
wrapper.$company_select.val(frappe.defaults.get_default("company") || r[0]).change();
wrapper.$company_select.val(frappe.defaults.get_user_default("company") || r[0]).change();
}
});
}

View File

@ -8,7 +8,7 @@ frappe.query_reports["Accounts Payable"] = {
"label": frappe._("Company"),
"fieldtype": "Link",
"options": "Company",
"default": frappe.defaults.get_default("company")
"default": frappe.defaults.get_user_default("company")
},
{
"fieldname":"account",

View File

@ -8,7 +8,7 @@ frappe.query_reports["Accounts Receivable"] = {
"label": frappe._("Company"),
"fieldtype": "Link",
"options": "Company",
"default": frappe.defaults.get_default("company")
"default": frappe.defaults.get_user_default("company")
},
{
"fieldname":"account",

View File

@ -22,7 +22,7 @@ frappe.query_reports["Budget Variance Report"] = {
label: frappe._("Company"),
fieldtype: "Link",
options: "Company",
default: frappe.defaults.get_default("company")
default: frappe.defaults.get_user_default("company")
},
]
}

View File

@ -45,7 +45,7 @@ frappe.query_reports["Item-wise Purchase Register"] = {
"label": frappe._("Company"),
"fieldtype": "Link",
"options": "Company",
"default": frappe.defaults.get_default("company")
"default": frappe.defaults.get_user_default("company")
}
]
}

View File

@ -39,7 +39,7 @@ frappe.query_reports["Item-wise Sales Register"] = frappe.query_reports["Sales R
"label": frappe._("Company"),
"fieldtype": "Link",
"options": "Company",
"default": frappe.defaults.get_default("company")
"default": frappe.defaults.get_user_default("company")
}
]
}

View File

@ -42,7 +42,7 @@ frappe.query_reports["Payment Period Based On Invoice Date"] = {
label: frappe._("Company"),
fieldtype: "Link",
options: "Company",
default: frappe.defaults.get_default("company")
default: frappe.defaults.get_user_default("company")
},
]
}

View File

@ -39,7 +39,7 @@ frappe.query_reports["Purchase Register"] = {
"label": frappe._("Company"),
"fieldtype": "Link",
"options": "Company",
"default": frappe.defaults.get_default("company")
"default": frappe.defaults.get_user_default("company")
}
]
}

View File

@ -39,7 +39,7 @@ frappe.query_reports["Sales Register"] = {
"label": frappe._("Company"),
"fieldtype": "Link",
"options": "Company",
"default": frappe.defaults.get_default("company")
"default": frappe.defaults.get_user_default("company")
}
]
}

View File

@ -29,7 +29,7 @@ frappe.query_reports["Monthly Attendance Sheet"] = {
"label": frappe._("Company"),
"fieldtype": "Link",
"options": "Company",
"default": frappe.defaults.get_default("company")
"default": frappe.defaults.get_user_default("company")
}
]
}

View File

@ -29,7 +29,7 @@ frappe.query_reports["Monthly Salary Register"] = {
"label": frappe._("Company"),
"fieldtype": "Link",
"options": "Company",
"default": frappe.defaults.get_default("company")
"default": frappe.defaults.get_user_default("company")
}
]
}

View File

@ -2,7 +2,7 @@
// License: GNU General Public License v3. See license.txt
cur_frm.cscript.onload = function(doc, cdt, cdn) {
cur_frm.set_value("company", frappe.defaults.get_default("company"))
cur_frm.set_value("company", frappe.defaults.get_user_default("company"))
cur_frm.set_value("use_multi_level_bom", 1)
}

View File

@ -36,7 +36,7 @@ var get_filters = function(){
"label": frappe._("Company"),
"fieldtype": "Link",
"options": "Company",
"default": frappe.defaults.get_default("company")
"default": frappe.defaults.get_user_default("company")
},
];
}

View File

@ -36,7 +36,7 @@ var get_filters = function(){
"label": frappe._("Company"),
"fieldtype": "Link",
"options": "Company",
"default": frappe.defaults.get_default("company")
"default": frappe.defaults.get_user_default("company")
},
];
}

View File

@ -9,7 +9,7 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({
var me = this;
if(this.frm.doc.__islocal) {
var today = get_today(),
currency = frappe.defaults.get_default("currency");
currency = frappe.defaults.get_user_default("currency");
$.each({
posting_date: today,
@ -18,8 +18,8 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({
currency: currency,
price_list_currency: currency,
status: "Draft",
company: frappe.defaults.get_default("company"),
fiscal_year: frappe.defaults.get_default("fiscal_year"),
company: frappe.defaults.get_user_default("company"),
fiscal_year: frappe.defaults.get_user_default("fiscal_year"),
is_subcontracted: "No",
}, function(fieldname, value) {
if(me.frm.fields_dict[fieldname] && !me.frm.doc[fieldname])

View File

@ -31,7 +31,7 @@ $.extend(erpnext, {
add_applicable_territory: function() {
if(cur_frm.doc.__islocal &&
frappe.model.get_doclist(cur_frm.doc.doctype, cur_frm.doc.name).length === 1) {
var default_territory = frappe.defaults.get_default("territory");
var default_territory = frappe.defaults.get_user_default("territory");
if(default_territory) {
var territory = frappe.model.add_child(cur_frm.doc, "Applicable Territory",
"valid_for_territories");

View File

@ -22,8 +22,8 @@ erpnext.selling.Opportunity = frappe.ui.form.Controller.extend({
set_multiple(cdt, cdn, { status:'Draft' });
if(!this.frm.doc.date)
this.frm.doc.transaction_date = date.obj_to_str(new Date());
if(!this.frm.doc.company && frappe.defaults.get_default("company"))
set_multiple(cdt, cdn, { company:frappe.defaults.get_default("company") });
if(!this.frm.doc.company && frappe.defaults.get_user_default("company"))
set_multiple(cdt, cdn, { company:frappe.defaults.get_user_default("company") });
if(!this.frm.doc.fiscal_year && sys_defaults.fiscal_year)
set_multiple(cdt, cdn, { fiscal_year:sys_defaults.fiscal_year });

View File

@ -33,7 +33,7 @@ frappe.query_reports["Sales Person-wise Transaction Summary"] = {
label: frappe._("Company"),
fieldtype: "Link",
options: "Company",
default: frappe.defaults.get_default("company")
default: frappe.defaults.get_user_default("company")
},
{
fieldname:"item_group",