frappe / agriculture

Agriculture Domain for ERPNext
GNU General Public License v3.0
45 stars 52 forks source link

Doesn't work properly on v14 #30

Open Agiarga opened 1 year ago

Agiarga commented 1 year ago

I installed the agriculture module on ERPNEXT_VERSION: v14.2.2, FRAPPE_VERSION: v14.10.0. Then I get the agriculture menu in ERPNext but only "Location" is available. I'm not the only one, see https://discuss.erpnext.com/t/v14-cant-install-agriculture-app/95340

littlebunyip commented 1 year ago

same issue here…

There are actually no agriculture related doctypes available in the awesomebar when I search for them by name but they are listed in the doctype list. There are also no agriculture related doctypes in the Role Permission Manager list. The reason the doctype “Location” is showing in the Agriculture workspace is because it is part of the Assets module.

Versions: Agriculture: v0.0.1 (develop) ERPNext: v14.10.0 (version-14) Frappe Framework: v14.18.1 (version-14) LittleBunyip: v0.0.1 (develop) Payments: v0.0.1 (develop) Wiki: v0.0.1 (master)

littlebunyip commented 1 year ago

I just got this app to install on v14. The reasons I found why it was not working with version 14 are:

Here is how I got it to work.

  1. Install the app with
    bench get-app agriculture
  2. Change the # Installation section of the file your-bench-directory/apps/agriculture/agriculture/hooks.py to:
    
    # Installation
    # ------------

before_install = "agriculture.install.before_install"

after_install = "agriculture.install.after_install"

after_install = "agriculture.agriculture.setup.setup_agriculture"

4. Install the agriculture app in your site. I only have one site so I don't need to use the `--site my-site-name` option.

bench install-app agriculture


5. Restart bench
6. Login into your erpnext  system as a user with admin permissions.
7. Go to the "Domain Settings" from the search bar and tick the Agriculture checkbox under "Active Domains"
8. Go back to your /app page and make sure to refresh the page in your browser.

The "Agriculture" heading should be in your sidebar and if you click the Agriculture menu it should show you the Agriculture Dashboard and the doctype should be accessible. You may have to add "Agriculture" to the list of enabled modules in your user settings and also select the Roles "Agriculture User" and "Agriculture Manager".
Emmytheo commented 6 months ago

I just got this app to install on v14. The reasons I found why it was not working with version 14 are:

  • The setup.py file is not run after install because in version 14 it needs to be called by the hooks.py file with the after_install key;
  • The domain "Agriculture" has to be specifically enabled in the Domain Settings doctype. Without this set we can see the doctypes in the doctype list but we cannot get to enter a specific doctype because of a module not found error;

Here is how I got it to work.

  1. Install the app with
bench get-app agriculture
  1. Change the # Installation section of the file your-bench-directory/apps/agriculture/agriculture/hooks.py to:
# Installation
# ------------

# before_install = "agriculture.install.before_install"
# after_install = "agriculture.install.after_install"
after_install = "agriculture.agriculture.setup.setup_agriculture"
  1. Install the agriculture app in your site. I only have one site so I don't need to use the --site my-site-name option.
bench install-app agriculture
  1. Restart bench
  2. Login into your erpnext system as a user with admin permissions.
  3. Go to the "Domain Settings" from the search bar and tick the Agriculture checkbox under "Active Domains"
  4. Go back to your /app page and make sure to refresh the page in your browser.

The "Agriculture" heading should be in your sidebar and if you click the Agriculture menu it should show you the Agriculture Dashboard and the doctype should be accessible. You may have to add "Agriculture" to the list of enabled modules in your user settings and also select the Roles "Agriculture User" and "Agriculture Manager".

This helped fix issues on my end.