Try ERPNext Buy Support Partners Foundation

Can we set limit for a doctype


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.


What are the possible limitations once can apply?

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

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

Gotta include the app name when installing :slight_smile:

@Jenisha Try this:

bench get-app

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/’"’"’; file=’"’"’/home/frappe/frappe-bench/apps/restriction/’"’"’;f=getattr(tokenize, β€˜"’"β€˜open’"’"’, open)(file);’"’"’\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/”, line 3, in
from pip.req import parse_requirements
ImportError: No module named β€˜pip.req’
ERROR: Command errored out with exit status 1: python 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