Is safe to modify python3 code in /apps/erpnext?

is safe to edit python code in apps/erpnext ?
it’s will safe if upgrate ERPnext ?

Thanks

You probably don’t want to. You can likely use the override doctype class in your custom app to achieve the desired result. Override Doctype Class

Thanks for you replies ,
this is not working
apps/custom_app/custom_app/overrides.py

apps/custom_app/custom_app/hooks.py

I can help, but you need to be more specific than “It’s not working”.

I’m try to override get_payment_url() method located in PaymentRequest class

i follow introduction on doc ( link you sent )
So i Override like what you see in screenshot

But still call super.method ( should be overrided ) not new one !

Thanks.

Your class name in the override should be the “presentation” doctype name, not the class name. That will get you to the next problem at least…

override_doctype_class = {
	'PaymentRequest': # incorrect
'custom_app.custom_app.overrides.payment_request.CustomPaymentRequest',
	'Payment Request': # correct
'custom_app.custom_app.overrides.payment_request.CustomPaymentRequest',
}
1 Like

It’s work , Thanks

1 Like