Employee naming by employee number

It’s working??

i create new site
then install frappe apps
all things worked well
then when i install my custom app the issue appear i try to know the matter from where came?

I removed the property setter JSON file from my app, and then I checked I had just 16 records in the property setter inside the system I did export fixtures that had the property setter, and then when I migrated they were up to 20 the 4 errors from where they came?

Are you getting errors in a property setter? What errors are you getting while migrating?

i fixed it
but still the error


there naming does not work as i want becuase this override i just add some new statuses just
when i commet this code its worked well and when i reorder the installed app it also worked well ?! @ejaaz


This function sets the naming in the Employee doctype. Your code looks the same as the Employee doctype; you have just added an extra status??

in validate method
yes and follow this video


Override this method and set your naming series in it.

i name it by employee number

Have you done this by overriding the autoname method?

no i just override the validation method by copy all the code and pased it then just change the status

as this said Last app will work what does it mean? - #2 by NCP

the naming by employee number will work just if i did oppesite the documentation ?!
mean if i reorder the hrms to be after my app :woman_shrugging:!!

Same as this

So you mean to order like this?

  1. Frappe
  2. erpnext
  3. my_app
  4. hrms… etc

Then check your custom app’s customizations. Maybe in your custom app’s customizations, it is set as ‘Employee naming series.’ And if I remember correctly, you have set the employee name by employee number in HR settings?

yes
but now i create new site and from hr setting i but the name to be employee number every thing rn well
then i create new app and add property setter to add some else status for employee and i custom the validate method by override it in my app by add just the new status
then run migrate then restart the services but the naming does not work in but order
hrms then test_app the status worked and the naming not and in test_app then hrms the naming worked but the status not


this all code i add to custom
and this is the property setter

as you see in the Module (for export) i select module of my test app but i search about it in side app i did not find it?

i just add this in hook file

When I override the validate function in employee to add new cases, the autoname function which exist in the employee doctype was called, even when the Employee Settings of Employee Naming By in the HR settings select the employee number. This behavior was contrary to the usual behavior that call the autoname method in employee master. Therefore, the autoname function was also override to resemble the usual behavior.

That’s what I said earlier :grin: ; it’s good that you found the solution :smile:.

yes i override it
but

i did not set my naming series
i could say i just change the behavior i did not set my naming series and i did not add any code as you offer :ok_hand: and thx for your help all the time with your ideas and i learn form you a lot

1 Like