Frappe Cloud Support Partners Foundation Frappe School

How to avoid loosing doctype modification on each bench update

Everytime I bench update, I have to go to every doctype to disable email validation on the email field (quote, sales order, sales invoice, payment entry).

And I have to set my default print format.

Is there a way to avoid erasing those modifications?

You can keep a backup of property setter doctype and import it after update. This is a manual way of ensuring your customizations are there after migrate.

Default print formats are set in the database, and likewise they shouldn’t get wiped on update. If you’re experiencing that, it’s possible there’s something not right.

For overrides, the answer depends on how exactly you’re doing them. Most code can be overridden in apps these days, so it should be possible to do why you want to do using the class override hook. If you post more details about what you’re doing we can provide more specific advice.

I have a similar questions on child table set-up. For ease of use we manually set child table to show by ticking in list view and giving it a number lik 1 or 2. On every bench update we need to reset these. These are not custom fix but as per core. Any way that the settings remain same in bench update and migrate?

Here are the two main things I always need to do. I have not email text in email fields so if email validation is enabled, I cant submit my documents.

And I need to go set my default print format after every update for sales order and sales invoices.

This is an example of X-Y problem:

Why do you need to remove email validations from email fields in first place?

  • Is it not working as expected? Create a bug report.
  • You’re storing non-email data in that field? Don’t use this field and create a custom field.

Customizations should never be done by editing doctypes. Use “Customize Form”.

First I use customize form.

Second, in the past with previous version, I was using the email filed and it was fine. The validation came with v13 which cause the problem. Now that there is no way to remove the “bad” email because the field is locked, I must disable the validation to be able to continue to use the system.

I don’t understand what you are describing here. Can you try again, with more detail and perhaps some images?

I’m not really understanding what you’re trying to do here. Why would you put non-email text in email fields?

In previous version of erpnext there were no email validation, so I used this field to put facebook profile link to the customers we were dealing with when we didnt had their email. Now this field is “locked” so I cant remove this info and the validation is a problem. This is why I need to disable email validation.

Only other solution I know is to do it manually in the database, but I dont know how to do that and I dont want to mess everything up.

I would have thought that the using the Customize Form tool to override field options would have worked, but if not any other solution is going to be a fair bit more complicated than just cleaning up your data. The problem can only going to get worse over time. ERPNext expects email data there, and the string validation is there to prevent problems in other places.

If you’re not comfortable manipulating the database directly, you could always use the console.

No need to fiddle with console or database. Use “Data Import” tool to bulk update your customer/supplier data. :wink: