iMoshi
September 9, 2019, 7:12am
1
Hello people, just realized something big. In our country it goes as “Last name” and “First name”. I’ve easily changed the positions in Employee DocType, but the Full name is section is still showing “fist name, last name”.
I know I can easily just rename those fields for an easy solution but am I missing a feature or a setting to change the positions…?
Thanks guys.
The full name is set via this function:
self.validate_onboarding_process()
if self.user_id:
self.validate_user_details()
else:
existing_user_id = frappe.db.get_value("Employee", self.name, "user_id")
if existing_user_id:
remove_user_permission(
"Employee", self.name, existing_user_id)
def set_employee_name(self):
self.employee_name = ' '.join(filter(lambda x: x, [self.first_name, self.middle_name, self.last_name]))
def validate_user_details(self):
data = frappe.db.get_value('User',
self.user_id, ['enabled', 'user_image'], as_dict=1)
if data.get("user_image"):
self.image = data.get("user_image")
self.validate_for_enabled_user_id(data.get("enabled", 0))
self.validate_duplicate_user_id()
Changing the field positions is not going to help. You can edit the function so the last name is set first.
1 Like
iMoshi
September 9, 2019, 4:59pm
3
Thank you so much!!! Cheers!
It worked for me as well, just a simple question.
Once we did bench update for example, i think the tweak will be replaced by update. Right?
I suggest you write a custom script for this. So that bench update will not undo the changes.