Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Contacts Module and Salutation and Gender in Contact #3079

Merged
merged 1 commit into from
Jun 13, 2017

Conversation

KanchanChauhan
Copy link
Contributor

@KanchanChauhan KanchanChauhan commented Apr 12, 2017

  • Address and Contact moved to Contacts module
  • Salutation and Gender as new Doctype

Also merge frappe/erpnext#9199

update_gender_and_salutation()

def update_gender_and_salutation():
default_genders = ["Male", "Female", "Other"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate code 😢


default_genders = ["Male", "Female", "Other"]

default_salutations = ["Dr.", "Mr.", "Ms.", "Mx.", "Sir", "Dame", "Esq.", "Lady", "Lord", "Mrs.", "Sire", "Madam", "Miss.", "Master", "Proff.", "Captain", "Mistress", "Gentleman", "President", "Principal"]
Copy link
Member

@rmehta rmehta Apr 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets not add the period . also Professor is Prof not Proff... Mistress ?? 😜

Lets only keep the common ones

update_gender_and_salutation()

def update_gender_and_salutation():
records = get_genders_and_salutations()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even insertion should be common

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get_genders_and_salutations() and add_genders_and_salutations(record) can be the same function!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for better readability and clarity :P

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KanchanChauhan KanchanChauhan force-pushed the salutation-in-contact branch 2 times, most recently from 6aa2243 to eaea35c Compare April 18, 2017 05:59
records = [{'doctype': 'Gender', 'gender': d} for d in default_genders]
records += [{'doctype': 'Salutation', 'salutation': d} for d in default_salutations]
for record in records:
doc_name = record.get("doctype")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have you tested if this works?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and removed the if exist code, not required since we are checking DuplicateEntryError

@rmehta rmehta merged commit f52e389 into frappe:develop Jun 13, 2017
nabinhait added a commit that referenced this pull request Jun 14, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants