I’m just new to Frappe/ERPNext. I am developing a custom app. I want to add a new business domain whenever my app is installed. I mean a business domain like Agriculture, Distribution, Education… not a domain name (btw, I find it’s very confusing by the term “Domain”. Every time I want to google it, all the results are about the web site domain name, the thing that comes after
To do that, I currently make a patch which inserts a row in the doctype Domain (DB table tabDomain) if it does not exist. The patch works correctly: when I run
bench --site ... migrate a row is inserted into the table as I expect.
However, when my app is installed from scratch (
bench --site ... install-app ...), the row that I expect was not inserted into table
tabDomain. I then check the table
tabPatch Log, my patch is there! It seems the bench command just marks my patch as executed but doesn’t really execute it. I delete the corresponding line in table
tabPatch Log and return
bench ... migrate, my row is inserted correctly.
I event made my patch syntax error but the
bench ... install-app still went well without any error. And the
tabPatch Log contains my erroneous patch!
What could I do wrong? What is the correct way to have patches executed upon
I am using source code of frappe and erpnext on branch
version-13. Version of bench is
Thanks for you help!