I won’t start with extending/inhereting the doctype first. It’s a nightmare to maintain overridden code.
- If you need extra fields just add custom fields - https://docs.erpnext.com/docs/user/manual/en/customize-form and https://docs.erpnext.com/docs/user/manual/en/custom-field
- If you need some business logic on those extra fields:
- Use server scripts - Server Script OR
- Use doc_event hooks from app - Hooks
- If you STILL can’t achieve all the functionality then override the entire class - Hooks
In general, “prefer extending over overriding” and your customizations will be maintainable long term.