fix(seller dialog): Email should be session user email (#15270)

This commit is contained in:
Faris Ansari 2018-08-30 19:19:57 +05:30 committed by Nabin Hait
parent 7e86d7b014
commit 91ac26c2ff

View File

@ -1,4 +1,4 @@
const ProfileDialog = (title = __('Edit Profile'), action={}, initial_values={}) => { const ProfileDialog = (title = __('Edit Profile'), action={}) => {
const fields = [ const fields = [
{ {
fieldtype: 'Link', fieldtype: 'Link',
@ -13,7 +13,6 @@ const ProfileDialog = (title = __('Edit Profile'), action={}, initial_values={})
.then(company => { .then(company => {
dialog.set_values({ dialog.set_values({
country: company.country, country: company.country,
company_email: company.email,
currency: company.default_currency currency: company.default_currency
}); });
}); });
@ -23,7 +22,7 @@ const ProfileDialog = (title = __('Edit Profile'), action={}, initial_values={})
{ {
fieldname: 'company_email', fieldname: 'company_email',
label: __('Email'), label: __('Email'),
fieldtype: 'Data' fieldtype: 'Read Only'
}, },
{ {
fieldname: 'country', fieldname: 'country',
@ -63,11 +62,10 @@ const ProfileDialog = (title = __('Edit Profile'), action={}, initial_values={})
} }
}); });
dialog.set_values(initial_values);
// Post create // Post create
const default_company = frappe.defaults.get_default('company'); const default_company = frappe.defaults.get_default('company');
dialog.set_value('company', default_company); dialog.set_value('company', default_company);
dialog.set_value('company_email', frappe.session.user);
return dialog; return dialog;
} }