Gr Tools
Grupo Real Tools and customizations for the business
- Author: AgileShift
- Repository: https://github.com/AgileShift/gr_tools
- GitHub stars: 3
- Forks: 3
- License: AGPL-3.0
- Category: Other
- Maintenance: Actively Maintained
- Frappe versions: develop
Install Gr Tools
bench get-app https://github.com/AgileShift/gr_tools
Add the Frappe Gems badge to your README
Maintain Gr Tools? Paste this into your README:
[](https://frappegems.com/gems/apps/AgileShift/gr_tools)
About Gr Tools
Grupo Real Tools
Introduction
This document outlines our custom configuration strategy for our Frappe sites.
We have adopted a unique approach that diverges from the standard use of fixtures and direct application of customizations through hooks.
Instead, we opt for a custom JSON loaded as a type of fixture using the aftermigrate_ hook.
Why We Do Not Use Standard Fixtures
Using fixtures in Frappe is a common practice for replicating configurations and data across multiple sites. However, this approach poses limitations when managing site-specific configurations in a multitenant environment. Standard fixtures overwrite existing configurations, potentially leading to the loss of critical site-specific customizations. Moreover, fixtures do not offer a straightforward way to manage subtle differences between sites without replicating multiple versions of the same fixture.
Why We Do Not Apply Customizations Directly Through Hooks
Applying customizations directly through individual hooks for each setting is another option. However, this method can become cumbersome and difficult to maintain as the number of customizations grows. Each customization would require its hook code, increasing the system's complexity and making cohesive management of configurations across multiple environments challenging.
Our Solution: Custom JSON and after_migrate Hook
We decided to adopt a hybrid approach that combines the flexibility of fixtures with the precision of custom hooks.
This approach involves creating a custom JSON that contains both general configurations applicable to all sites and site-specific configurations.
We use the after_migrate hook to conditionally load and apply these configurations based on the current site.
Advantages of Our Approach
- Flexibility: Our custom JSON allows for easy adaptation to the specific needs of each site without compromising general configurations.
- Maintainability: Centralizing configurations in a single JSON file facilitates updates and maintenance, reducing complexity.
- Efficient Automation: Using the after_migrate hook to apply configurations ensures that each site is correctly configured automatically after each migration, minimizing the need for manual interventions.
How It Works
- Preparation of Custom JSON: We create a JSON file detailing the general and site-specific configurations.
- Use of after_migrate Hook: In hooks.py, we specify a method to run after migration to read the custom JSON and apply the corresponding configurations to the current site.
- Conditional Application of Configurations: The method identifies the current site, extracts the relevant configurations from the custom JSON, and applies them using Frappe's API.
Conclusion
Our decision to use a custom JSON loaded through the after_migrate hook represents a balance between the need for customization and operational efficiency.
This approach allows us to manage configurations flexibly and keep our Frappe sites optimized and aligned with the specific requirements of each environment.
Related Other apps for Frappe & ERPNext
- Erpnext — Free and Open Source Enterprise Resource Planning (ERP)
- Helpdesk — Modern, Streamlined, Free and Open Source Customer Service Software
- Print Designer — Visual print designer for Frappe / ERPNext
- Ctr — CTR模型代码和学习笔记总结
- Whitelabel — Whitelabel ERPNext
- Fossunited — fossunited.org
- Helm — Helm Chart Repository for Frappe/ERPNext
- Frappe Attachments S3 — A frappe app to upload file attachments in doctypes to s3.