agriculture icon indicating copy to clipboard operation
agriculture copied to clipboard

Doesn't work properly on v14

Open Agiarga opened this issue 2 years ago • 3 comments

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

Agiarga avatar Oct 06 '22 23:10 Agiarga

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 avatar Dec 11 '22 19:12 littlebunyip

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".

littlebunyip avatar Mar 20 '23 06:03 littlebunyip

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.

Emmytheo avatar Mar 24 '24 17:03 Emmytheo