Comments (7)
@mohsinalimat you're mostly running into this issue only. Perms exported via "Export customization" are forcefully synced.
from frappe.
What is the point of exporting a customisation if sync_on_migrate is not set?
Sync on install, but never again. It's useful in a lot of cases too.
from frappe.
What is the point of exporting a customisation if sync_on_migrate is not set?
Sync on install, but never again. It's useful in a lot of cases too.
On install of the app? So any additions in later versions are ignored.
from frappe.
Yeah.
from frappe.
Prop setters now sync by default instead of overriding: #25918
IDK if anyone really wants to delete all current prop setter and sync from code 😅
from frappe.
Idk any good solution for custom docperms yet, maybe best to remove it from this feature. Removal of docperm might actually mean it needs to be removed while syncing, so there's no way to guess intent from current version of code alone.
from frappe.
@ankush
Here's a patch I wrote to fix the behaviour, might be useful:
# for ensuring customisations exist instead of sync_on_migrate
import frappe
import os
import json
def insert(dt, doc):
doc["doctype"] = dt
d = frappe.get_doc(doc)
d.insert()
def execute():
path = frappe.get_app_path("app", "module", "custom")
customs = [os.path.join(path, f) for f in os.listdir(path) if os.path.isfile(os.path.join(path, f))]
for custom in customs:
with open(custom) as f:
data = json.loads(f.read())
for key, docs in data.items():
if not isinstance(docs, list):
continue
for doc in docs:
try:
if key == "property_setters":
insert("Property Setter", doc)
if key == "custom_fields":
insert("Custom Field", doc)
except frappe.DuplicateEntryError:
pass
frappe.db.commit()
EDIT: needs to be a normal insert to create the db table!
from frappe.
Related Issues (20)
- Modal: Double clicking primary button triggers primary action twice HOT 1
- (Minor) frappe.db.delete doesn't seem to trigger hooks but its written in method's docstring HOT 1
- On Leaderboard - Company select field is missing, only on first selected menu. HOT 1
- no bulk edit when workflow active HOT 1
- Show Title of Link in TimeLine
- Contact Details "Vertical" HOT 1
- Contact Details "Vertical" HOT 1
- frappe command to setup ldap
- Workflow permission by user (field value)
- The "Awesome Bar" is not calculating correctly. HOT 1
- !!client_script frappe.listview_settings filter dont work HOT 1
- Showing virtual fields in list view causes an exception
- Unable to Access Server API HOT 1
- "Click here to post bugs and suggestions" when doctype is Beta - always call https://github.com/frappe/{app_name}
- Display JS Not Working For Column Break
- internal Links in print formats
- JS deprecated document.write for loading scripts caused by `defer` missing
- Report view sorting for child table
- Bug in v15.24.1 using command add-to-hosts HOT 1
- Copy to Clipboard for doctype, Error: Mandatory field 'name' is missing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from frappe.