Try ERPNext Buy Support Partners Foundation

Can we set limit for a doctype

Hi,

I need to know if we can set limit for doctype or not. I tried to set limit for company in site_config.json but its not working.
Kindly help, thanks!

1 Like

@Jenisha Limit in respect to what exactly you want ?

@Jenisha try this custom app:

Hi @Mohammed_Redha

What does this custom app do?

Its for limiting a site, for example to have only two companies.

Thank you! will try this.

Cool

What are the possible limitations once can apply?

You can limit users, company etc. Will try and confirm.

Hi,
I tried installing that app in my bench , got the below error,

I gave the below command, not sure what went wrong

bench get-app https://github.com/maisonarmani/Restriction/tree/master/restriction

Gotta include the app name when installing :slight_smile:

@Jenisha Try this:

bench get-app https://github.com/maisonarmani/Restriction

I tried the same command, still got the below error,

INFO:bench.utils:./env/bin/pip install -q -U -e ./apps/restriction
ERROR: Command errored out with exit status 1:
command: /home/frappe/frappe-bench/env/bin/python3 -c β€˜import sys, setuptools, tokenize; sys.argv[0] = β€˜"’"’/home/frappe/frappe-bench/apps/restriction/setup.py’"’"’; file=’"’"’/home/frappe/frappe-bench/apps/restriction/setup.py’"’"’;f=getattr(tokenize, β€˜"’"β€˜open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, β€˜"’"’\n’"’"’);f.close();exec(compile(code, file, β€˜"’"β€˜exec’"’"’))’ egg_info
cwd: /home/frappe/frappe-bench/apps/restriction/
Complete output (5 lines):
Traceback (most recent call last):
File β€œβ€, line 1, in
File β€œ/home/frappe/frappe-bench/apps/restriction/setup.py”, line 3, in
from pip.req import parse_requirements
ImportError: No module named β€˜pip.req’
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Hello @Jenisha, Any progress in this, did you find the way to limit the company in one site?

Nope, u can see the error above. I am using frappe docker for local site, not sure why i am getting this error. I will try and update.

@Jenisha What ERPNext version are you using?

Its 12.3.1