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